Skip to content

Commit

Permalink
Merge pull request #20 from mattermost/hh_oct25-rewrite-table-parsing
Browse files Browse the repository at this point in the history
MM-61148 Rewrite table parsing based off of cmark-gfm
  • Loading branch information
hmhealey authored Nov 12, 2024
2 parents 238f58c + bdd88ab commit c50146e
Show file tree
Hide file tree
Showing 9 changed files with 1,545 additions and 296 deletions.
344 changes: 225 additions & 119 deletions dist/commonmark.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/commonmark.min.js

Large diffs are not rendered by default.

348 changes: 226 additions & 122 deletions lib/blocks.js

Large diffs are not rendered by default.

3 changes: 3 additions & 0 deletions lib/render/html.js
Original file line number Diff line number Diff line change
Expand Up @@ -288,12 +288,15 @@ function table_row(node, entering) {
this.cr();
} else {
this.tag("/tr");
this.cr();

if (node === node.parent.firstChild) {
this.cr(); // we're not consistent about how these tags are laid out because this is what GitHub does
this.tag("/thead");
this.cr();
} else if (node === node.parent.lastChild) {
this.tag("/tbody");
this.cr();
}
}
}
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@mattermost/commonmark",
"description": "the Mattermost fork of a strongly specified, highly compatible variant of Markdown",
"version": "0.30.1-2",
"version": "0.30.1-3",
"homepage": "https://commonmark.org",
"keywords": [
"markdown",
Expand Down
Loading

0 comments on commit c50146e

Please sign in to comment.