Skip to content

TOC generation should replace <br/> in headers with space #2105

Closed
elmimmo opened this Issue · 1 comment

2 participants

@elmimmo

When generating the TOC for EPUB, Pandoc understandably strips HTML markup inside headers. It should still account for line breaks, and substitute them with spaces.

When a header is

# First chapter<br/><span class="subtitle">The beginning</span>

its TOC entry should be

First chapter The beginning

which might not be ideal but is unquestionably better than the current output:

First chapterThe beginning

Note that <br/> might exist for presentation purposes (so it is irrelevant whether you agree or not with the above markup being appropriate for subtitles).

@elmimmo

In the meantime, this can be worked around by manually adding a space after br which, being a space at the beginning of line, will not render (if I am not mistaken), but Pandoc will still keep it as a separator of words when generating the TOC.

@mpickering mpickering added the bug label
@jgm jgm added a commit that closed this issue
@jgm EPUB TOC: replace literal "<br/>" with space.
Closes #2105.
9894012
@jgm jgm closed this in 9894012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.