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
Strange behaviors of block elements in paged-footnotes #156
Comments
In pagedown, pagedown/inst/resources/js/hooks.js Lines 208 to 321 in d96b5e2
In the example, the markdown footnote is collapsed because the list (which is a block element) is turned into an inline span (this is the job of the Pandoc filter). For the HTML footnote, the reason is different. Pandoc parses this markup as raw HTML as you can see in the JSON serialization of the AST: {"blocks":[{"t":"Para","c":[{"t":"Str","c":"A"},{"t":"Space"},{"t":"Str","c":"sentence."},{"t":"Span","c":[["fn1",["footnote"],[["data-pagedown-footnote-number","1"],["style","white-space: pre-line;"]]],[{"t":"RawInline","c":["html","<ul>"]},{"t":"Str","c":"\n"},{"t":"RawInline","c":["html","<li>"]},{"t":"Str","c":"\na\n"},{"t":"RawInline","c":["html","</li>"]},{"t":"Str","c":"\n"},{"t":"RawInline","c":["html","<li>"]},{"t":"Str","c":"\nb\n"},{"t":"RawInline","c":["html","</li>"]},{"t":"Str","c":"\n"},{"t":"RawInline","c":["html","</ul>"]}]]}]},{"t":"Para","c":[{"t":"Str","c":"Another"},{"t":"Space"},{"t":"Str","c":"sentence."},{"t":"Span","c":[["fn2",["footnote"],[["data-pagedown-footnote-number","2"],["style","white-space: pre-line;"]]],[{"t":"Str","c":"ab"}]]}]}],"pandoc-api-version":[1,17,5,4],"meta":{"newpage_html_class":{"t":"MetaString","c":"page-break-after"},"paged-footnotes":{"t":"MetaBool","c":true},"output":{"t":"MetaMap","c":{"pagedown::html_paged":{"t":"MetaMap","c":{"keep_md":{"t":"MetaBool","c":true}}}}}}} Pandoc's HTML writer takes this raw HTML asis. So, the generated markup is: <p>A sentence.<span id="fn1" class="footnote" style="white-space: pre-line;" data-pagedown-footnote-number="1"><ul>
<li>
a
</li>
<li>
b
</li>
</ul></span></p> Having a block element like <span id="fn1" class="footnote" style="white-space: pre-line;" data-pagedown-footnote-number="1"></span> I think I will add in the documentation that |
Thanks a lot for the explanation, and for the plan to update the documentation!! |
Great! Thank you! |
For example, a footnote with bullet list in html is rendered in the body, and leaves the empty footnote at the bottom of the page.
A footnote with bullet list in markdown is collapsed.
They work fine when
paged-footnotes: false
.Source Rmd
Output
The text was updated successfully, but these errors were encountered: