File tree 1 file changed +10
-2
lines changed
1 file changed +10
-2
lines changed Original file line number Diff line number Diff line change @@ -213,10 +213,18 @@ var insideFenced = false
213
213
var insideIndented = false
214
214
var currentCodeBlockStart = - 1
215
215
216
- // check whether the current line in document is within a fenced or indented
216
+ // check whether the current line in document is within a fenced or indented
217
217
// code block
218
218
func isLineWithinCodeBlock (lines []string , lineIndex int , line string ) bool {
219
- // if line is already within code fences or indented code block
219
+ // Reset global state from previous runs
220
+ if lineIndex == 0 {
221
+ insideInline = false
222
+ insideFenced = false
223
+ insideIndented = false
224
+ currentCodeBlockStart = - 1
225
+ }
226
+
227
+ // if line is already within code fences or indented code block
220
228
if insideFenced {
221
229
if fencedEndRegex .FindStringIndex (line ) != nil &&
222
230
lines [currentCodeBlockStart ][:3 ] == line [:3 ] {
You can’t perform that action at this time.
0 commit comments