-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
Convert Wordpress caption to figure #3141
Conversation
09653f1
to
467e3da
Compare
Don't get why the build is failing... When raising an error to see ouput, it's as if 1b360ac was not merged 🤔 |
It seems clear that 1b360ac was indeed merged. It appears in |
467e3da
to
0fa27fc
Compare
@justinmayer ok after a lot more debugging, I finally understood, it's due to the pandoc version used in github actions (2.9.2) being different than the one on my machine (3.0.1). If you check the output in the action below, you see that <p><figure>
<img src="/theme/img/xpelican.png.pagespeed.ic.Rjep0025-y.png"/>
<figcaption>This is a pelican</figcaption>
</figure></p> is converted using ![This is a pelican](/theme/img/xpelican.png.pagespeed.ic.Rjep0025-y.png) https://github.com/mart-e/pelican/actions/runs/5174375780/jobs/9320618059#step:8:78 I may have been a bit optimistic on #3114 solving all issues. Only pandoc 3.0 has a proper support for
The easiest for my issue would be to upgrade the required vrsion of pandoc but it's probably not the best as even the latest ubuntu is still in 2.17. I see better solutions:
I tend to prefer the first one but it brings a different result based on the version of pandoc installed. Let me know if ok with you. edit: did that in the second commit, will merge them if ok |
I agree that the first option sounds better. 👍 |
7bc72a7
to
da86a52
Compare
In Wordpress, inserting image with a caption can look like: [caption id="attachment_42" caption="Image Description"]<a ...><img ... /></a>[/caption] [caption id="attachment_42"]<a ...><img ... /></a> Image Description[/caption] [caption id="attachment_42"]<img ... > Image Description[/caption] Replace by an HTML figure tag
da86a52
to
48166bd
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Many thanks for your work on this, Martin. We can revisit this topic once Pandoc 3.0+ is ubiquitous, but until then your solution strikes a good balance. 👍
In Wordpress, inserting image with a caption can look like
Replace by an HTML
<figure>
tagPull Request Checklist
PS: feel free to suggest a better regex, this was tested with a few examples taken from my blog.