-
Notifications
You must be signed in to change notification settings - Fork 335
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
Earmark GFM Footnote Return to Article Link Text Rendered Incorrectly #1452
Comments
@jwilger looking at the earmark code you linked, it is not set |
In addition to looking into @josevalim's comment above, there's a somewhat kludgy workaround using CSS for anyone else who runs into this; just add the following to your def project do
[
# ...
docs: [
# ...
before_closing_head_tag: &before_closing_head_tag/1
]
]
end
defp before_closing_head_tag(:html) do
"""
<style>
a.reversefootnote {
display: inline-block;
text-indent: -9999px;
line-height: 0;
}
a.reversefootnote:after {
content: ' ↩'; /* or any other text you want */
text-indent: 0;
display: block;
line-height: initial;
}
</style>
"""
end
defp before_closing_head_tag(_), do: "" |
Closing this, as I believe it is not an ExDoc issue! |
If you, like me, find your way to this issue because footnotes render like this: ... despite using
a.footnote {
font-size: 0.7em;
vertical-align: super;
} ... but beware: I know barely any CSS. |
We probably need to add the CSS to ExDoc? Would you like to send a PR? |
This reverts commit a1bac85.
I submitted a PR to earmark_parser that I believe fixes this issue: RobertDober/earmark_parser#163 |
* elixir-lang/ex_doc#1452 (comment) * Revert "elixir-lang/ex_doc#1452 (comment)" This reverts commit a1bac85. * verbatim option tests * elixir-lang/ex_doc#1452 (comment) * tests fix
this includes a fix for elixir-lang#1452 and an important fix for OTP-28 to avoid regular exprssions at compile time
Fix for #1452 and avoiding regexes at compile time (for OTP-28)
When parsing a markdown document that contains footnotes with the option
footnotes: true
passed to Earmark, the link that is inserted at the end of the footnote by Earmark has the link text set to["↩"]
(https://github.com/RobertDober/earmark_parser/blob/5797a53a1d60003e5d0038c326bfd1e8b129c85f/lib/earmark_parser/ast/renderer/footnote_renderer.ex#L31).When rendering the documentation as HTML via ex_doc, this link text is escaped, replacing the
&
with&
, so that the literal↩
is displayed in the text rather than the HTML entity that was intended.It looks like ex_doc can take a
verbatim: true
option when rendering a tag (ex_doc/lib/ex_doc/doc_ast.ex
Line 49 in 7dbc937
The text was updated successfully, but these errors were encountered: