Skip to content

Commit 08f924f

Browse files
committed
chore: build 14.1.1
1 parent be4202d commit 08f924f

File tree

4 files changed

+23
-6
lines changed

4 files changed

+23
-6
lines changed

dist/index.cjs.js

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1866,10 +1866,17 @@ function text_join(state) {
18661866
tokens[curr].type = 'text';
18671867
}
18681868
}
1869-
for (curr = last = 0; curr < max; curr++) {
1869+
for (curr = last = 0; curr < tokens.length; curr++) {
18701870
if (tokens[curr].type === 'text' && curr + 1 < max && tokens[curr + 1].type === 'text') {
18711871
// collapse two adjacent text nodes
18721872
tokens[curr + 1].content = tokens[curr].content + tokens[curr + 1].content;
1873+
1874+
// only move forward position when left token has content
1875+
if (tokens[curr].content) {
1876+
tokens[curr + 1].position = tokens[curr].position;
1877+
}
1878+
// add up size
1879+
tokens[curr + 1].size = (tokens[curr].size || 0) + (tokens[curr + 1].size || 0);
18731880
} else {
18741881
if (curr !== last) {
18751882
tokens[last] = tokens[curr];
@@ -4076,6 +4083,8 @@ function escape(state, silent) {
40764083
}
40774084
token.markup = origStr;
40784085
token.info = 'escape';
4086+
// size should reflect original source span (including backslash)
4087+
token.size = origStr.length;
40794088
}
40804089
state.pos = pos + 1;
40814090
return true;

dist/markdown-it.js

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/*! @hackmd/markdown-it 14.1.0 https://github.com/hackmdio/markdown-it @license MIT */
1+
/*! @hackmd/markdown-it 14.1.1 https://github.com/hackmdio/markdown-it @license MIT */
22
(function(global, factory) {
33
typeof exports === "object" && typeof module !== "undefined" ? module.exports = factory() : typeof define === "function" && define.amd ? define(factory) : (global = typeof globalThis !== "undefined" ? globalThis : global || self,
44
global.markdownit = factory());
@@ -2628,10 +2628,16 @@
26282628
tokens[curr].type = "text";
26292629
}
26302630
}
2631-
for (curr = last = 0; curr < max; curr++) {
2631+
for (curr = last = 0; curr < tokens.length; curr++) {
26322632
if (tokens[curr].type === "text" && curr + 1 < max && tokens[curr + 1].type === "text") {
26332633
// collapse two adjacent text nodes
26342634
tokens[curr + 1].content = tokens[curr].content + tokens[curr + 1].content;
2635+
// only move forward position when left token has content
2636+
if (tokens[curr].content) {
2637+
tokens[curr + 1].position = tokens[curr].position;
2638+
}
2639+
// add up size
2640+
tokens[curr + 1].size = (tokens[curr].size || 0) + (tokens[curr + 1].size || 0);
26352641
} else {
26362642
if (curr !== last) {
26372643
tokens[last] = tokens[curr];
@@ -4672,6 +4678,8 @@
46724678
}
46734679
token.markup = origStr;
46744680
token.info = "escape";
4681+
// size should reflect original source span (including backslash)
4682+
token.size = origStr.length;
46754683
}
46764684
state.pos = pos + 1;
46774685
return true;

dist/markdown-it.min.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@hackmd/markdown-it",
3-
"version": "14.1.0",
3+
"version": "14.1.1",
44
"description": "Markdown-it - modern pluggable markdown parser.",
55
"keywords": [
66
"markdown",

0 commit comments

Comments
 (0)