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

Use CommonMark block markdown style for Kramdown markdown=1 #1761

Closed

Conversation

harding
Copy link
Collaborator

@harding harding commented Jun 28, 2024

Part of #1551

Kramdown allows an HTML block or span element to contain markdown=1, markdown=span, or markdown=block to trigger markdown parsing within that element. Hugo's Goldmark Commonmark parser requires an empty space after the HTML element open and before the element close to trigger the same behavior.

This commit adds the Commonmark behavior in addition to the Kramdown behavior. We'll have to maintain both until we're fully transitioned.

No test for this is provided.

This PR can be partly reviewed by diffing the site build before and after this commit:

git checkout #this branch
make clean build
cp -a _site _newsite
git reset --hard HEAD^
make clean build
cp -a _site _oldsite
diff --ignore-blank-lines -ruNw _oldsite/ _site/ | colordiff | less -R

That will show you the changes. I've spot checked most of the source differences and they look the same on the rendered page on my browser.

Kramdown allows an HTML block or span element to contain markdown=1,
markdown=span, or markdown=block to trigger markdown parsing within that
element.  Hugo's Goldmark Commonmark parser requires an empty space
after the HTML element open and before the element close to trigger the
same behavior.

This commit adds the Commonmark behavior in addition to the Kramdown
behavior.  We'll have to maintain both until we're fully transitioned.

No test for this is provided.
@bitschmidty
Copy link
Contributor

Concept ACK, but also want to run locally

Copy link
Contributor

@bitschmidty bitschmidty left a comment

Choose a reason for hiding this comment

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

tACK

  • ran modified version of @harding commands to diff html output
  • manually reviewed a few html differences
  • visually compared a few page types where there were differences (a topic page, en news, zh news)
  • searched for any potentially missed markdown="1" instances in the code

@harding feel free to merge when you are ready

@harding
Copy link
Collaborator Author

harding commented Aug 2, 2024

Rebased on latest master in combination with #1757, ran all tests, and pushed to master.

@harding harding closed this Aug 2, 2024
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.

2 participants