@adobe/helix-markdown-support 3.1.1 → 3.1.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.github/workflows/semantic-release.yaml +2 -2
- package/CHANGELOG.md +21 -0
- package/package.json +10 -10
- package/src/mdast-robust-tables.js +15 -8
|
@@ -9,9 +9,9 @@ jobs:
|
|
|
9
9
|
runs-on: ubuntu-latest
|
|
10
10
|
if: "!contains(github.event.head_commit.message, '[skip ci]')"
|
|
11
11
|
steps:
|
|
12
|
-
- uses: actions/checkout@
|
|
12
|
+
- uses: actions/checkout@v3
|
|
13
13
|
- name: Use Node.js 14.x
|
|
14
|
-
uses: actions/setup-node@
|
|
14
|
+
uses: actions/setup-node@v3
|
|
15
15
|
with:
|
|
16
16
|
node-version: '14.x'
|
|
17
17
|
- run: npm install
|
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,24 @@
|
|
|
1
|
+
## [3.1.4](https://github.com/adobe/helix-markdown-support/compare/v3.1.3...v3.1.4) (2022-05-10)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Bug Fixes
|
|
5
|
+
|
|
6
|
+
* preserve spans ([#109](https://github.com/adobe/helix-markdown-support/issues/109)) ([9d6ba00](https://github.com/adobe/helix-markdown-support/commit/9d6ba00e2623349bf469ab56bb093f5dbed976fc))
|
|
7
|
+
|
|
8
|
+
## [3.1.3](https://github.com/adobe/helix-markdown-support/compare/v3.1.2...v3.1.3) (2022-05-10)
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
### Bug Fixes
|
|
12
|
+
|
|
13
|
+
* keep html in table paragraphs ([#108](https://github.com/adobe/helix-markdown-support/issues/108)) ([9b3ea28](https://github.com/adobe/helix-markdown-support/commit/9b3ea28a1fd785e575a56bb99d47f1c07ef2a88e))
|
|
14
|
+
|
|
15
|
+
## [3.1.2](https://github.com/adobe/helix-markdown-support/compare/v3.1.1...v3.1.2) (2022-01-24)
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
### Bug Fixes
|
|
19
|
+
|
|
20
|
+
* **deps:** update external fixes ([#86](https://github.com/adobe/helix-markdown-support/issues/86)) ([addbdae](https://github.com/adobe/helix-markdown-support/commit/addbdae518dead84f9057da6dc799a1ec8c52779))
|
|
21
|
+
|
|
1
22
|
## [3.1.1](https://github.com/adobe/helix-markdown-support/compare/v3.1.0...v3.1.1) (2022-01-15)
|
|
2
23
|
|
|
3
24
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@adobe/helix-markdown-support",
|
|
3
|
-
"version": "3.1.
|
|
3
|
+
"version": "3.1.4",
|
|
4
4
|
"description": "Helix Markdown Support",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"scripts": {
|
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
"dependencies": {
|
|
25
25
|
"hast-util-to-html": "8.0.3",
|
|
26
26
|
"js-yaml": "4.1.0",
|
|
27
|
-
"mdast-util-to-hast": "12.1.
|
|
27
|
+
"mdast-util-to-hast": "12.1.1",
|
|
28
28
|
"unist-util-find": "1.0.2",
|
|
29
29
|
"unist-util-visit": "4.1.0"
|
|
30
30
|
},
|
|
@@ -41,22 +41,22 @@
|
|
|
41
41
|
"@adobe/eslint-config-helix": "1.3.2",
|
|
42
42
|
"@semantic-release/changelog": "6.0.1",
|
|
43
43
|
"@semantic-release/git": "10.0.1",
|
|
44
|
-
"c8": "7.11.
|
|
44
|
+
"c8": "7.11.2",
|
|
45
45
|
"codecov": "3.8.3",
|
|
46
|
-
"eslint": "8.
|
|
46
|
+
"eslint": "8.15.0",
|
|
47
47
|
"eslint-plugin-header": "3.1.1",
|
|
48
|
-
"eslint-plugin-import": "2.
|
|
49
|
-
"husky": "
|
|
48
|
+
"eslint-plugin-import": "2.26.0",
|
|
49
|
+
"husky": "8.0.1",
|
|
50
50
|
"junit-report-builder": "3.0.0",
|
|
51
|
-
"lint-staged": "12.1
|
|
51
|
+
"lint-staged": "12.4.1",
|
|
52
52
|
"mdast-builder": "1.1.1",
|
|
53
|
-
"mocha": "
|
|
53
|
+
"mocha": "10.0.0",
|
|
54
54
|
"mocha-multi-reporters": "1.5.1",
|
|
55
55
|
"remark-gfm": "3.0.1",
|
|
56
56
|
"remark-parse": "10.0.1",
|
|
57
57
|
"remark-stringify": "10.0.2",
|
|
58
|
-
"semantic-release": "
|
|
59
|
-
"unified": "10.1.
|
|
58
|
+
"semantic-release": "19.0.2",
|
|
59
|
+
"unified": "10.1.2",
|
|
60
60
|
"unist-util-inspect": "7.0.0"
|
|
61
61
|
},
|
|
62
62
|
"lint-staged": {
|
|
@@ -29,20 +29,26 @@ export default function robustTables(tree) {
|
|
|
29
29
|
(node.children /* c8 ignore next */ || []).forEach((row) => {
|
|
30
30
|
html += ' <tr>\n';
|
|
31
31
|
(row.children /* c8 ignore next */ || []).forEach((cell) => {
|
|
32
|
-
let
|
|
32
|
+
let attrs = '';
|
|
33
33
|
if (cell.align === 'right') {
|
|
34
|
-
|
|
34
|
+
attrs = ' align="right"';
|
|
35
35
|
} else if (cell.align === 'center') {
|
|
36
|
-
|
|
36
|
+
attrs = ' align="center"';
|
|
37
37
|
} else if (cell.align === 'both') {
|
|
38
|
-
|
|
38
|
+
attrs = ' align="justify"';
|
|
39
39
|
}
|
|
40
40
|
if (cell.valign === 'middle') {
|
|
41
|
-
|
|
41
|
+
attrs += ' valign="middle"';
|
|
42
42
|
} else if (cell.valign === 'bottom') {
|
|
43
|
-
|
|
43
|
+
attrs += ' valign="bottom"';
|
|
44
44
|
}
|
|
45
|
-
|
|
45
|
+
if (cell.rowSpan > 1) {
|
|
46
|
+
attrs += ` rowspan="${cell.rowSpan}"`;
|
|
47
|
+
}
|
|
48
|
+
if (cell.colSpan > 1) {
|
|
49
|
+
attrs += ` colspan="${cell.colSpan}"`;
|
|
50
|
+
}
|
|
51
|
+
html += ` <td${attrs}>`;
|
|
46
52
|
|
|
47
53
|
// if cell contains only 1 single paragraph, unwrap it
|
|
48
54
|
let { children } = cell;
|
|
@@ -54,7 +60,8 @@ export default function robustTables(tree) {
|
|
|
54
60
|
if (child.type === 'html') {
|
|
55
61
|
html += child.value;
|
|
56
62
|
} else {
|
|
57
|
-
const
|
|
63
|
+
const hast = md2hast(child, { allowDangerousHtml: true });
|
|
64
|
+
const cellHtml = hast2html(hast, { allowDangerousHtml: true });
|
|
58
65
|
if (child.type === 'code') {
|
|
59
66
|
// code needs special treatment, otherwise the newlines disappear.
|
|
60
67
|
html += cellHtml.replace(/\r?\n/g, '<br>');
|