-
Notifications
You must be signed in to change notification settings - Fork 977
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
Update pulldown_cmark dep to v0.10, and add pulldown_cmark_escape dep. #2432
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,6 @@ | ||
--- | ||
source: components/rendering/tests/markdown.rs | ||
assertion_line: 79 | ||
source: components/markdown/tests/markdown.rs | ||
expression: body | ||
|
||
--- | ||
<h1 id="hello-1">Hello</h1> | ||
<h1 id="hello-2">Hello</h1> | ||
|
@@ -22,6 +20,6 @@ expression: body | |
<h1 id="text-there">text <sup class="footnote-reference"><a href="#1">1</a></sup> there</h1> | ||
<div class="footnote-definition" id="1"><sup class="footnote-definition-label">1</sup> | ||
<p>footnote</p> | ||
<h1 id="classes" class="bold another">Classes</h1> | ||
</div> | ||
<h1 id="classes" class="bold another">Classes</h1> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. so it was inserting the header in the footnote? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yeah, seems like it. pulldown-cmark 0.10 contains a bunch of footnotes-related fixes, which I'm guessing are responble for this change. Since the new version seems to be correct and the old version seemed wrong, I didn't investigate further to figure out exactly which commit fixed this. |
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,6 @@ | ||
--- | ||
source: components/rendering/tests/shortcodes.rs | ||
assertion_line: 104 | ||
source: components/markdown/tests/shortcodes.rs | ||
expression: body | ||
|
||
--- | ||
<p>{{ youtube(id="w7Ft2ymGmfc") }}</p> | ||
<p>{{ youtube(id="w7Ft2ymGmfc") }}</p> | ||
|
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.
how come it's not escaping anymore here?
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.
I believe this is due to a behavior change in pulldown-cmark, rather than the changes I made in this pull request. I think it might be pulldown-cmark/pulldown-cmark#830, specifically. It introduces a new
escape_html_body_text
which should be used for escaping text nodes and which only escapes '<', '>', and '&', as opposed toescape_html
which should be used for escaping HTML attributes and which escapes single and double quotes as well.I believe that pulldown-cmark's
push_html
will now convert Event::Text nodes to HTML usingescape_html_body_text
(see src/html.rs in that pull request), hence why we see these quotes not being escaped anymore. This is also why we need to handle the alt attribute's text manually now, to ensure it gets attribute-escaped rather than body-escaped (which is now the default).And FWIW, all other existing uses of
escape_html
that I could find in Zola were for escaping HTML attributes, so I think none of them need to be switched toescape_html_body_text
.