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

fix link parsing #121

Merged
merged 13 commits into from
Apr 19, 2023
Merged

fix link parsing #121

merged 13 commits into from
Apr 19, 2023

Conversation

zkamvar
Copy link
Contributor

@zkamvar zkamvar commented Apr 18, 2023

This fixes link parsing to take into account links that have markdown inside them.

[a _link_ with **markdown**]({{ page.root }}/linkie)

This will fix #120

This also updates jekyll image attribute parsing and takes into account attributes that are situated on a separate line as the image:

![image alt text](https://placekitten.com/200/200)
{.image-with-shadow}

This addresses #119, but does not necessarily fix it because figure attributes on new lines are not allowed (afaict):

pandoc::pandoc_convert(text = "![a](link)\n{alt='b'}", to = "html")
#> <p><img src="link" alt="a" /> {alt=‘b’}</p>
pandoc::pandoc_convert(text = "![a](link){alt='b'}", to = "html")
#> <figure>
#> <img src="link" alt="b" />
#> <figcaption>a</figcaption>
#> </figure>

Created on 2023-04-18 with reprex v2.0.2

@zkamvar zkamvar marked this pull request as ready for review April 19, 2023 15:13
@zkamvar zkamvar merged commit c677760 into main Apr 19, 2023
@zkamvar zkamvar deleted the fix-link-parsing branch April 19, 2023 15:20
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.

[kramdown] links with markdown and liquid formatting don't survive roundtrip
1 participant