markmap-lib 0.18.1-alpha.1 → 0.18.2
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/dist/browser/index.iife.js +25 -11
- package/dist/browser/index.mjs +19 -4
- package/dist/index.js +1 -1
- package/dist/index.mjs +1 -1
- package/dist/index.no-plugins.js +1 -1
- package/dist/index.no-plugins.mjs +1 -1
- package/dist/plugins.js +18 -3
- package/dist/plugins.mjs +18 -3
- package/package.json +4 -4
|
@@ -14106,7 +14106,12 @@
|
|
|
14106
14106
|
if (!$child.is(options.selector)) return;
|
|
14107
14107
|
skippingHeading = 0;
|
|
14108
14108
|
const isHeading = level <= 6;
|
|
14109
|
-
let data2 =
|
|
14109
|
+
let data2 = {
|
|
14110
|
+
// If the child is an inline element and expected to be a separate node,
|
|
14111
|
+
// data from the closest `<p>` should be included, e.g. `<p data-lines><img /></p>`
|
|
14112
|
+
...$child.closest("p").data(),
|
|
14113
|
+
...$child.data()
|
|
14114
|
+
};
|
|
14110
14115
|
let html22 = result.html || "";
|
|
14111
14116
|
if ($child.is("ol>li") && (node == null ? void 0 : node.children)) {
|
|
14112
14117
|
const start = +($child.parent().attr("start") || 1);
|
|
@@ -14117,12 +14122,6 @@
|
|
|
14117
14122
|
listIndex
|
|
14118
14123
|
};
|
|
14119
14124
|
}
|
|
14120
|
-
if ($child.children("code:only-child").length) {
|
|
14121
|
-
data2 = {
|
|
14122
|
-
...data2,
|
|
14123
|
-
...$child.children().data()
|
|
14124
|
-
};
|
|
14125
|
-
}
|
|
14126
14125
|
const childNode = addChild({
|
|
14127
14126
|
parent: node || getCurrentHeading(level),
|
|
14128
14127
|
nesting: !!result.queue || isHeading,
|
|
@@ -25980,14 +25979,29 @@ ${end2.comment}` : end2.comment;
|
|
|
25980
25979
|
md.renderer.renderAttrs = wrapFunction(
|
|
25981
25980
|
md.renderer.renderAttrs,
|
|
25982
25981
|
(renderAttrs, token) => {
|
|
25983
|
-
let attrs = renderAttrs(token);
|
|
25984
25982
|
if (token.block && token.map) {
|
|
25985
25983
|
const lineRange = token.map.map((line) => line + frontmatterLines);
|
|
25986
|
-
|
|
25984
|
+
token.attrSet("data-lines", lineRange.join(","));
|
|
25987
25985
|
}
|
|
25988
|
-
return
|
|
25986
|
+
return renderAttrs(token);
|
|
25989
25987
|
}
|
|
25990
25988
|
);
|
|
25989
|
+
if (md.renderer.rules.fence) {
|
|
25990
|
+
md.renderer.rules.fence = wrapFunction(
|
|
25991
|
+
md.renderer.rules.fence,
|
|
25992
|
+
(fence2, tokens, idx, ...rest) => {
|
|
25993
|
+
let result = fence2(tokens, idx, ...rest);
|
|
25994
|
+
const token = tokens[idx];
|
|
25995
|
+
if (result.startsWith("<pre>") && token.map) {
|
|
25996
|
+
const lineRange = token.map.map(
|
|
25997
|
+
(line) => line + frontmatterLines
|
|
25998
|
+
);
|
|
25999
|
+
result = result.slice(0, 4) + ` data-lines=${lineRange.join(",")}` + result.slice(4);
|
|
26000
|
+
}
|
|
26001
|
+
return result;
|
|
26002
|
+
}
|
|
26003
|
+
);
|
|
26004
|
+
}
|
|
25991
26005
|
});
|
|
25992
26006
|
return {};
|
|
25993
26007
|
}
|
|
@@ -26090,7 +26104,7 @@ ${end2.comment}` : end2.comment;
|
|
|
26090
26104
|
}
|
|
26091
26105
|
}
|
|
26092
26106
|
const transformerVersions = {
|
|
26093
|
-
"markmap-lib": "0.18.
|
|
26107
|
+
"markmap-lib": "0.18.2"
|
|
26094
26108
|
};
|
|
26095
26109
|
exports.Transformer = Transformer;
|
|
26096
26110
|
exports.builtInPlugins = builtInPlugins;
|
package/dist/browser/index.mjs
CHANGED
|
@@ -369,14 +369,29 @@ const plugin = definePlugin({
|
|
|
369
369
|
md.renderer.renderAttrs = wrapFunction(
|
|
370
370
|
md.renderer.renderAttrs,
|
|
371
371
|
(renderAttrs, token) => {
|
|
372
|
-
let attrs = renderAttrs(token);
|
|
373
372
|
if (token.block && token.map) {
|
|
374
373
|
const lineRange = token.map.map((line) => line + frontmatterLines);
|
|
375
|
-
|
|
374
|
+
token.attrSet("data-lines", lineRange.join(","));
|
|
376
375
|
}
|
|
377
|
-
return
|
|
376
|
+
return renderAttrs(token);
|
|
378
377
|
}
|
|
379
378
|
);
|
|
379
|
+
if (md.renderer.rules.fence) {
|
|
380
|
+
md.renderer.rules.fence = wrapFunction(
|
|
381
|
+
md.renderer.rules.fence,
|
|
382
|
+
(fence, tokens, idx, ...rest) => {
|
|
383
|
+
let result = fence(tokens, idx, ...rest);
|
|
384
|
+
const token = tokens[idx];
|
|
385
|
+
if (result.startsWith("<pre>") && token.map) {
|
|
386
|
+
const lineRange = token.map.map(
|
|
387
|
+
(line) => line + frontmatterLines
|
|
388
|
+
);
|
|
389
|
+
result = result.slice(0, 4) + ` data-lines=${lineRange.join(",")}` + result.slice(4);
|
|
390
|
+
}
|
|
391
|
+
return result;
|
|
392
|
+
}
|
|
393
|
+
);
|
|
394
|
+
}
|
|
380
395
|
});
|
|
381
396
|
return {};
|
|
382
397
|
}
|
|
@@ -479,7 +494,7 @@ class Transformer {
|
|
|
479
494
|
}
|
|
480
495
|
}
|
|
481
496
|
const transformerVersions = {
|
|
482
|
-
"markmap-lib": "0.18.
|
|
497
|
+
"markmap-lib": "0.18.2"
|
|
483
498
|
};
|
|
484
499
|
export {
|
|
485
500
|
Transformer,
|
package/dist/index.js
CHANGED
package/dist/index.mjs
CHANGED
package/dist/index.no-plugins.js
CHANGED
package/dist/plugins.js
CHANGED
|
@@ -266,14 +266,29 @@ const plugin = definePlugin({
|
|
|
266
266
|
md.renderer.renderAttrs = markmapCommon.wrapFunction(
|
|
267
267
|
md.renderer.renderAttrs,
|
|
268
268
|
(renderAttrs, token) => {
|
|
269
|
-
let attrs = renderAttrs(token);
|
|
270
269
|
if (token.block && token.map) {
|
|
271
270
|
const lineRange = token.map.map((line) => line + frontmatterLines);
|
|
272
|
-
|
|
271
|
+
token.attrSet("data-lines", lineRange.join(","));
|
|
273
272
|
}
|
|
274
|
-
return
|
|
273
|
+
return renderAttrs(token);
|
|
275
274
|
}
|
|
276
275
|
);
|
|
276
|
+
if (md.renderer.rules.fence) {
|
|
277
|
+
md.renderer.rules.fence = markmapCommon.wrapFunction(
|
|
278
|
+
md.renderer.rules.fence,
|
|
279
|
+
(fence, tokens, idx, ...rest) => {
|
|
280
|
+
let result = fence(tokens, idx, ...rest);
|
|
281
|
+
const token = tokens[idx];
|
|
282
|
+
if (result.startsWith("<pre>") && token.map) {
|
|
283
|
+
const lineRange = token.map.map(
|
|
284
|
+
(line) => line + frontmatterLines
|
|
285
|
+
);
|
|
286
|
+
result = result.slice(0, 4) + ` data-lines=${lineRange.join(",")}` + result.slice(4);
|
|
287
|
+
}
|
|
288
|
+
return result;
|
|
289
|
+
}
|
|
290
|
+
);
|
|
291
|
+
}
|
|
277
292
|
});
|
|
278
293
|
return {};
|
|
279
294
|
}
|
package/dist/plugins.mjs
CHANGED
|
@@ -264,14 +264,29 @@ const plugin = definePlugin({
|
|
|
264
264
|
md.renderer.renderAttrs = wrapFunction(
|
|
265
265
|
md.renderer.renderAttrs,
|
|
266
266
|
(renderAttrs, token) => {
|
|
267
|
-
let attrs = renderAttrs(token);
|
|
268
267
|
if (token.block && token.map) {
|
|
269
268
|
const lineRange = token.map.map((line) => line + frontmatterLines);
|
|
270
|
-
|
|
269
|
+
token.attrSet("data-lines", lineRange.join(","));
|
|
271
270
|
}
|
|
272
|
-
return
|
|
271
|
+
return renderAttrs(token);
|
|
273
272
|
}
|
|
274
273
|
);
|
|
274
|
+
if (md.renderer.rules.fence) {
|
|
275
|
+
md.renderer.rules.fence = wrapFunction(
|
|
276
|
+
md.renderer.rules.fence,
|
|
277
|
+
(fence, tokens, idx, ...rest) => {
|
|
278
|
+
let result = fence(tokens, idx, ...rest);
|
|
279
|
+
const token = tokens[idx];
|
|
280
|
+
if (result.startsWith("<pre>") && token.map) {
|
|
281
|
+
const lineRange = token.map.map(
|
|
282
|
+
(line) => line + frontmatterLines
|
|
283
|
+
);
|
|
284
|
+
result = result.slice(0, 4) + ` data-lines=${lineRange.join(",")}` + result.slice(4);
|
|
285
|
+
}
|
|
286
|
+
return result;
|
|
287
|
+
}
|
|
288
|
+
);
|
|
289
|
+
}
|
|
275
290
|
});
|
|
276
291
|
return {};
|
|
277
292
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "markmap-lib",
|
|
3
|
-
"version": "0.18.
|
|
3
|
+
"version": "0.18.2",
|
|
4
4
|
"description": "Visualize your Markdown as mindmaps with Markmap",
|
|
5
5
|
"author": "Gerald <gera2ld@live.com>",
|
|
6
6
|
"license": "MIT",
|
|
@@ -74,8 +74,8 @@
|
|
|
74
74
|
"markdown-it-mark": "^4.0.0",
|
|
75
75
|
"markdown-it-sub": "^2.0.0",
|
|
76
76
|
"markdown-it-sup": "^2.0.0",
|
|
77
|
-
"markmap-html-parser": "0.18.
|
|
78
|
-
"markmap-view": "0.18.
|
|
77
|
+
"markmap-html-parser": "0.18.2",
|
|
78
|
+
"markmap-view": "0.18.2",
|
|
79
79
|
"prismjs": "^1.29.0",
|
|
80
80
|
"yaml": "^2.5.1"
|
|
81
81
|
},
|
|
@@ -96,5 +96,5 @@
|
|
|
96
96
|
"^(.*\\.svg)\\?raw$": "$1"
|
|
97
97
|
}
|
|
98
98
|
},
|
|
99
|
-
"gitHead": "
|
|
99
|
+
"gitHead": "75261f82190df5b126faf6f6dc82adeb1c3a2cc2"
|
|
100
100
|
}
|