Skip to content

Commit 85717b4

Browse files
committed
12.0.23
1 parent f619e05 commit 85717b4

File tree

4 files changed

+19
-7
lines changed

4 files changed

+19
-7
lines changed

dist/markdown-it.js

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/*! @hackmd/markdown-it 12.0.22 https://github.com/hackmdio/markdown-it @license MIT */
1+
/*! @hackmd/markdown-it 12.0.23 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());
@@ -2893,13 +2893,25 @@
28932893
return str.toLowerCase().toUpperCase();
28942894
}
28952895
function getLineOffset(state) {
2896-
if (state.env.parentToken.parentType === "blockquote") {
2896+
if (isInBlockquote(state)) {
28972897
const blockState = state.env.state_block;
28982898
return blockState.lineOffsets[state.currentLine] ?? 0;
28992899
} else {
29002900
return 0;
29012901
}
29022902
}
2903+
function isInBlockquote(state) {
2904+
let count = 0;
2905+
for (let i = state.env.parentTokenIndex; i >= 0; i--) {
2906+
const token = state.env.parentState.tokens[i];
2907+
if (token.type === "blockquote_open" || token.type === "alert_open") {
2908+
count++;
2909+
} else if (token.type === "blockquote_close" || token.type === "alert_close") {
2910+
count--;
2911+
}
2912+
}
2913+
return count > 0;
2914+
}
29032915
function trimLeftOffset(str) {
29042916
return str.length - str.trimLeft().length;
29052917
}

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-lock.json

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": "12.0.22",
3+
"version": "12.0.23",
44
"description": "Markdown-it - modern pluggable markdown parser.",
55
"keywords": [
66
"markdown",

0 commit comments

Comments
 (0)