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

CommonMark code block class names #1265

Merged
merged 1 commit into from
May 11, 2018
Merged

CommonMark code block class names #1265

merged 1 commit into from
May 11, 2018

Conversation

remyrylan
Copy link
Contributor

@remyrylan remyrylan commented May 11, 2018

This is a very simple fix to follow the CommonMark spec for code blocks:
https://spec.commonmark.org/0.27/ Example: https://spec.commonmark.org/0.27/#example-109

Right now Marked defaults to lang- for fenced code blocks, which as far I understand it, is legacy from Highlight.js. By enforcing the CommonMark standard developers will be able to leverage other CommonMark tools when using output from Marked.

Contributor

  • Test(s) exist to ensure functionality and minimize regression (if no tests added, list tests covering this PR); or,
  • no tests required for this PR.

Committer

In most cases, this should be a different person than the contributor.

  • Draft GitHub release notes have been updated.
  • CI is green (no forced merge required).
  • Merge PR

@remyrylan
Copy link
Contributor Author

I'll look into the failing tests later, Travis appears to be down at the moment (rendering only a blank white page).

@UziTech
Copy link
Member

UziTech commented May 11, 2018

looks like the tests /test/new/gfm_code.html and /test/new/gfm_code_hr_list.html uses lang-. You can change them to use language-

and example 111 and 113 can be taken out of shouldPassButFail in /test/specs/commonmark/commonmark-spec.js

var shouldPassButFails = [93, 95, 96, 97, 101, 102, 106, 108, 111, 112, 113];

@remyrylan
Copy link
Contributor Author

@UziTech Updating right now. Pushing a new commit within 5 mins. Sorry I missed them earlier.

@remyrylan
Copy link
Contributor Author

Ok, new commit pushed. Tests pass for me locally. Thank you so much for the help and super fast response, @UziTech!

@UziTech
Copy link
Member

UziTech commented May 11, 2018

No problem. Thanks for the PR 💯

Copy link
Member

@UziTech UziTech left a comment

Choose a reason for hiding this comment

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

Can you revert marked.min.js that will be updated automatically when the PR is merged

man/marked.1.txt Outdated
@@ -56,7 +56,7 @@ OPTIONS
--smart-lists
Use smarter list behavior than the original markdown.

--lang-prefix [prefix]
--language-prefix [prefix]
Copy link
Member

Choose a reason for hiding this comment

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

this parameter should still be --lang-prefix since that is what the option is called

@remyrylan
Copy link
Contributor Author

Fixing everything now, pushing in a few moments. Will undo the changes to marked.min.js in my other PR as well.

man/marked.1.txt Outdated
@@ -8,7 +8,7 @@ NAME

SYNOPSIS
marked [-o <output>] [-i <input>] [--help] [--tokens] [--pedantic]
[--gfm] [--breaks] [--tables] [--sanitize] [--smart-lists] [--lang-pre‐
[--gfm] [--breaks] [--tables] [--sanitize] [--smart-lists] [--language-pre‐
Copy link
Member

Choose a reason for hiding this comment

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

this should also be --lang

@remyrylan
Copy link
Contributor Author

remyrylan commented May 11, 2018

Ok all changes in and fixed the Git history.

Copy link
Member

@UziTech UziTech left a comment

Choose a reason for hiding this comment

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

Nice 🎉 Thanks again 🥇

@UziTech UziTech requested review from styfle and joshbruce May 11, 2018 15:16
@styfle styfle added this to the 0.4.0 - No known defects milestone May 11, 2018
@styfle
Copy link
Member

styfle commented May 11, 2018

This will be a breaking change but our next release has several breaking changes so good timing, thanks! 👍

zhenalexfan pushed a commit to zhenalexfan/MarkdownHan that referenced this pull request Nov 8, 2021
CommonMark code block class names
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.

3 participants