srid / emanote

Emanate a structured view of your plain-text notes
https://emanote.srid.ca
Other
808 stars 71 forks source link

Remove footnotes from `og:description` #529

Open TristanCacqueray opened 6 months ago

TristanCacqueray commented 6 months ago

This change remove any footnotes from the og:description header.

TristanCacqueray commented 6 months ago

I'm sure there is a better way to filter the pandoc ast, but that fixes my issue.

TristanCacqueray commented 6 months ago

Sure, thanks, that's much better!

srid commented 6 months ago

@TristanCacqueray Have you tested it to work? Because it is not working for me:

image
TristanCacqueray commented 6 months ago

I remember testing the change to heist-extra, but looking at the code it does not seem to make sense (the catchall is already removing unmatched inlines). First of all, the function comes from commonmark-wikilink, and using query does not seem to be enough as it descends the Note node even when it is replaced with mempty. So I think we still need to somehow filter that node from the tree.

TristanCacqueray commented 6 months ago

@srid sorry about that, now using commonmark-wikilink.url = "github:TristanCacqueray/commonmark-wikilink/plainify-without-notes"; seems to work for the adding-images description.

srid commented 6 months ago

Something's still off, because the "Paste Image" part repeats at the end.

image
srid commented 3 months ago

@TristanCacqueray It would be good to merge this, after that issue above (https://github.com/srid/emanote/pull/529#issuecomment-2018733384) is resolved.

TristanCacqueray commented 3 months ago

@srid I agree, unfortunately I don't have much time to work on this at the moment.