We’re getting an error message that shows up on the Epub export which reads:
Begin Chapter Error on line 12, col. 215. Opening and ending tag mismatch
Was wondering what it means and what steps we might take to troubleshoot and fix the issue.
Hi Mark, thanks for your question! Could you please share a link to the book on the Rebus Press?
If possible, please also share any screenshots you have of the error itself, as this might help us troubleshoot the issue.
Sure, here is the link: https://press.rebus.community/introductiontocommunitypsychology/
It has the same warning each time but the line & column numbers are different for each chapter. We only see it happen on an iPad (related to Apple books perhaps), but other ePubs look fine.
Hi Mark, thanks for the link and the screenshot.
I’ve taken a look, and it appears that the
tag in the title of Chapter 1 “Introduction to the Field of Community Psychology” was causing the error. Removing this tag resolved the issue, and you can confirm the same with a new export.
The error reports for the EPUB also indicated that the different weights for the PT Serif fonts were not properly loaded – perhaps you could check to see that all the custom CSS for the fonts has been correctly entered. Generally, we recommend against uploading custom fonts for e-books, as this tends to increase the file size of the book.
There were also some small error messages around glossary terms - while these did not have any impact on being able to open or view the EPUB, I’ve still reported the error to the Pressbooks support team to troubleshoot. I’ll keep you posted as I hear from them.
Please let me know if you have any more questions. I look forward to hearing a confirmation about the resolved error message “Begin Chapter Error on line 12, col. 215. Opening and ending tag mismatch.”
Thanks for your reply. Unfortunately, I’m still getting the “error on line 12 at column 215” message in Chapter 1. However, I no longer see that error in any of the other chapters. I looked at the tags in the code and found the following invalid tag at the very beginning:
. I removed the tag, but alas, it didn’t do anything to fix the issue.
Hi Mark! I’d suggest deleting the EPUB files from your computer and iBooks library. Then, export a new EPUB file and open it in iBooks. Sometimes an older file might mean that you’re seeing a cached display, so deleting the files first will confirm that you’re looking at the newest version.
Let me know how you get on.
Thanks for the suggestion–turns out the tag
tag was reinserted in the title without my knowledge. That’s why the error message reappeared. We were using the
tag to format the chapter title which needed a line break in the middle. The fix was to simply insert a slash mark to close the tag as follows:
. Apparently the EPUB export follows XHTML or XML where different rules make the
tag is invalid and even empty tags like
must be self-closed. Hence for the EPUB only the
is used. This rule doesn’t apply to other formats, however. Thanks for your help with this.
Hi Mark, thanks for clearing this up. I’m glad to hear that adding a slash mark to close the tag (like so:
<br/>) resolved the issue.
Always happy to help! Let us know if anything else comes up, but hopefully it’s smooth sailing onwards for you and the team.