Skip to content
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

Write FB2 lists without nesting blocks inside <p> #4004

Merged
merged 1 commit into from
Oct 29, 2017
Merged

Conversation

link2xt
Copy link
Collaborator

@link2xt link2xt commented Oct 29, 2017

According to FB2 XML schema <empty-line /> cannot be placed inside
<p>. Linux FBReader can't display such paragraphs, e.g. any "loose"
lists produced by pandoc prior to this commit. Besides that,
FB2 writer placed <p> inside <p> when writing nested lists,
this commit fixes the bug.

Also this commit removes leading non-breaking space from ordered
lists for consistency with bullet lists.

Definition lists are not affected at all.

According to FB2 XML schema <empty-line /> cannot be placed inside
<p>. Linux FBReader can't display such paragraphs, e.g. any "loose"
lists produced by pandoc prior to this commit.  Besides that,
FB2 writer placed <p> inside <p> when writing nested lists,
this commit fixes the bug.

Also this commit removes leading non-breaking space from ordered
lists for consistency with bullet lists.

Definition lists are not affected at all.
@link2xt
Copy link
Collaborator Author

link2xt commented Oct 29, 2017

There are some obvious bugs remaining like inconsistency between bullet lists and ordered lists. Nested ordered lists retain parent markers, while nested bullet list don't, so when you nest ordered lists inside bullet lists, indentation is broken. Also indentation with nonbreaking spaces does not display correctly due to nonmonospace fonts in FBReader. Maybe it works with something like fbless.

Definition lists are broken too it seems and the whole function paraToPlain should be removed at some point once they are fixed, I just have not tested them yet.

Lack of support for lists and some standardized way to create markers in FB2 is just a problem of the format so I had to stop at some point, there are just too many bugs to fix at a time. At least at this point pandoc produces lists that FBReader can display.

@jgm jgm merged commit 3263d0d into jgm:master Oct 29, 2017
@jgm
Copy link
Owner

jgm commented Oct 29, 2017

Great, thanks!

@link2xt link2xt deleted the fb2-lists branch October 30, 2017 00:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants