Skip to content

Commit 037f253

Browse files
🐛 Fix: undefined variable in reference block (#45)
Co-authored-by: Chris Sewell <chrisj_sewell@hotmail.com>
1 parent ee34305 commit 037f253

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

markdown_it/rules_block/reference.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,7 @@ def reference(state: StateBlock, startLine, _endLine, silent):
7474
string = state.getLines(startLine, nextLine, state.blkIndent, False).strip()
7575
maximum = len(string)
7676

77+
labelEnd = None
7778
pos = 1
7879
while pos < maximum:
7980
ch = charCodeAt(string, pos)
@@ -90,7 +91,9 @@ def reference(state: StateBlock, startLine, _endLine, silent):
9091
lines += 1
9192
pos += 1
9293

93-
if labelEnd < 0 or charCodeAt(string, labelEnd + 1) != 0x3A: # /* : */
94+
if (
95+
labelEnd is None or labelEnd < 0 or charCodeAt(string, labelEnd + 1) != 0x3A
96+
): # /* : */
9497
return False
9598

9699
# [label]: destination 'title'

0 commit comments

Comments
 (0)