Skip to content

CommonMark code block class names - #1265

Merged
styfle merged 1 commit into
markedjs:masterfrom
RemyRylan:master
May 11, 2018
Merged

CommonMark code block class names#1265
styfle merged 1 commit into
markedjs:masterfrom
RemyRylan:master

Conversation

@RemyRylan

@RemyRylanRemyRylan commented May 11, 2018

Copy link
Copy Markdown
Contributor

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
Copy Markdown
ContributorAuthor

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
Copy Markdown
Member

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

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

@RemyRylan

Copy link
Copy Markdown
ContributorAuthor

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

@RemyRylan

Copy link
Copy Markdown
ContributorAuthor

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

@UziTech

Copy link
Copy Markdown
Member

No problem. Thanks for the PR 💯

@UziTechUziTech left a comment

Copy link
Copy Markdown
Member

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

Comment threadman/marked.1.txt Outdated
Use smarter list behavior than the original markdown.

--lang-prefix [prefix]
--language-prefix [prefix]

Copy link
Copy Markdown
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
Copy Markdown
ContributorAuthor

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

Comment threadman/marked.1.txt Outdated
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
Copy Markdown
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

RemyRylan commented May 11, 2018

Copy link
Copy Markdown
ContributorAuthor

Ok all changes in and fixed the Git history.

@UziTechUziTech left a comment

Copy link
Copy Markdown
Member

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 joshbruce and styfleMay 11, 2018 15:16
@styflestyfle added this to the 0.4.0 - No known defects milestone May 11, 2018
@styfle

Copy link
Copy Markdown
Member

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
Sign up for freeto 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

@RemyRylan@UziTech@styfle