Skip to content
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

Remove footnotes from og:description #529

Open
wants to merge 10 commits into
base: master
Choose a base branch
from

Conversation

TristanCacqueray
Copy link
Contributor

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

This change remove any footnotes from the og:description header.
@TristanCacqueray
Copy link
Contributor Author

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

TristanCacqueray added a commit to TristanCacqueray/TristanCacqueray.github.io that referenced this pull request Mar 15, 2024
@srid srid changed the title description: remove footnotes description: remove footnotes from og:description Mar 15, 2024
@srid srid changed the title description: remove footnotes from og:description Remove footnotes from og:description Mar 15, 2024
Copy link
Owner

@srid srid left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@TristanCacqueray I think it is better to fix it at the source itself, so whoever calls this function will benefit:

https://github.com/srid/heist-extra/blob/6b609c347754b15d8796c3d70d0ef6fb0ada8ca5/src/Heist/Extra/Splices/Pandoc/Render.hs#L280-L294

What do you think?

@TristanCacqueray
Copy link
Contributor Author

Sure, thanks, that's much better!

@srid
Copy link
Owner

srid commented Mar 18, 2024

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

image

@TristanCacqueray
Copy link
Contributor Author

TristanCacqueray commented Mar 25, 2024

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
Copy link
Contributor Author

@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
Copy link
Owner

srid commented Mar 25, 2024

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

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants