obsidian-export icon indicating copy to clipboard operation
obsidian-export copied to clipboard

Inline footnotes not exported correctly

Open AB1908 opened this issue 3 years ago • 1 comments

I have found that inline footnotes don't export correctly. For example:

This is text. ^[This is an inline footnote.]

which should render as

image

exports as

This is text. \^[This is an inline footnote.]

I also found that the referenced link style isn't preserved. Is this intended behavior? If so, I can always devise a workaround to manually extract those links but it'd be much cleaner if you could add that functionality.

As a final note, I think a hint in the readme that the user needs to do a chmod +x would be very useful. I was certainly guilty of not doing so at first.

AB1908 avatar Aug 01 '21 22:08 AB1908

Thanks for this report, @AB1908.

I have found that inline footnotes don't export correctly.

Obsidian-export uses pulldown_cmark, a CommonMark-compliant parser, to process markdown. Unfortunately, the CommonMark specification doesn't include footnotes, though the [^footnote] syntax is fairly universally supported by CommonMark parsers.

I had never come across this ^[inline] syntax before, but now I wish it was supported. :slightly_smiling_face: This would have to be implemented within the pulldown_cmark library however, so it's not something I have control over.

If you'd like to pursue this, I would recommend you file a feature request with pulldown_cmark, explaining the syntax for such inline footnotes and pointing to other Markdown implementations that support this to show how widespread it is.

I also found that the referenced link style isn't preserved. Is this intended behavior?

I don't understand what you mean by this, could you elaborate?

As a final note, I think a hint in the readme that the user needs to do a chmod +x would be very useful. I was certainly guilty of not doing so at first.

Good point! I'll make a note of this.


Edit: relevant external references regarding footnotes:

  • https://github.com/raphlinus/pulldown-cmark/issues/530
  • https://github.com/commonmark/commonmark-spec/wiki/Deployed-Extensions#note

zoni avatar Aug 28 '21 09:08 zoni