markdown-viewer
markdown-viewer copied to clipboard
Back anchor in footnote can have a better style
as in the picture below, the back anchor start in a new line:

what about make it appear at the end of relevant footnote like this:

I think minor change will make it more clear about which footnote the back anchor goes.
PS: I was using remark for rendering
This is looking weird indeed, thanks for the feedback!
Is this a behavior of the compiler? I try to fix this by myself but failed. All I jumped into are the refered codes.
It is a compiler issue regarding Remark. You can read about it here: https://github.com/syntax-tree/mdast-util-to-hast/issues/14
FYI the fix for this issue has been merged: https://github.com/syntax-tree/mdast-util-to-hast/pull/15
Thanks @vhf I'll take a look at it shortly.
No it has not. In fact, syntax-tree/mdast-util-to-hast#15 now makes inline footnotes, which were not affected before, also show the same issue.
→ By wrapping the footnote in a P element and forcing the backlink outside, the backlink can no longer appear at the end of the line.
Which is a pity, since having the backlink at the end of the line is the most common and least confusing layout.
With the change in syntax-tree/mdast-util-to-hast#15, getting the layout the OP wanted is now impossible.

Getting this result requires the backlink to be within the block of the text.
Well to be fair the following workaround works. But wrapping stuff in a block element, only to make it inline again so the wrapping does not break the expected flow, talk about a hack.
.footnotes > ol > li > p:only-of-type { display: inline; }
Yes, the problem persists, that's why I haven't closed the issue yet.
Seems to be fixed in Markdown Viewer v5.2 for both of the compilers that has support for footnotes: remark and markdown-it.