Skip to content

XML comments in FB2 are not ignored but displayed to the user as normal book content #972

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
van-de-bugger opened this issue Nov 10, 2022 · 0 comments
Labels
bug Something isn't working

Comments

@van-de-bugger
Copy link

Bug description

FB2 format is XML-based. XML allows comments (<!-- ... -->), which should be ignored, but Foliate shows them as book content. Here is an example:

<?xml version="1.0" encoding="UTF-8"?>
<FictionBook xmlns="http://www.gribuser.ru/xml/fictionbook/2.0" xmlns:l="http://www.w3.org/1999/xlink">
<body>
  <title>
    <!-- This is a comment. Foliate should *not* display it. -->
    <p>Author</p>
    <p>Book Title</p>
  </title>
   <section>
     <title>
       <p>Chaper One</p>
     </title>
     <p>Lorem ipsum.</p>
   </section>
</body>
</FictionBook>

Note line 5: <!-- This is a comment. Foliate should *not* display it. -->. It is a comment, not a part of book text. It is expected comments are not displayed to book readers, but Foliate displays them. Moreover, Foliate strips <!-- and -->, so comments are presented to the user as normal book content.

To Reproduce

  1. Download the attachment: example.fb2.zip (It is a copy of the example above, zipped because github does not allow to upload *.fb2 files.)
  2. Start Foliate.
  3. Open the downloaded example.fb2.zip file.
  4. Look the the book text. It starts with "This is a comment. Foliate should not display it."

Expected behavior

Text "This is a comment. Foliate should *not* display it." is not displayed.

Screenshots

Screenshot from 2022-11-10 14-52-03
Text "This is a comment. Foliate should *not* display it." should not be displayed.

Version:

  • Foliate version: 2.6.4
  • OS/Distribution and version: Fedora 36
  • Desktop environment: GNOME 42
  • Installation method: RPM (foliate-2.6.4-2.fc36.noarch)
@van-de-bugger van-de-bugger added the bug Something isn't working label Nov 10, 2022
johnfactotum added a commit that referenced this issue Nov 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants