133
134
if (inFencedBlock) {
135
>
// Check for closing fence: same char, at least same length, only whitespace after
annotations.ts
136
>
const closeLength = countLeadingChar(trimmed, fenceChar);
137
>
if (closeLength >= fenceLength && trimmed.substring(closeLength).trim() === '') {
138
inFencedBlock = false;
139
unfencedLines.length = 0;
140
}
142
>
}
143
144
// Check for opening fence (3+ backticks or tildes at start of line)
145
const firstChar = trimmed[0];
146
if (firstChar === '`' || firstChar === '~') {
147
>
const openLength = countLeadingChar(trimmed, firstChar);
annotations.ts
148
>
// Backtick fences: info string must not contain backticks
149
>
if (openLength >= 3 && (firstChar === '~' || !trimmed.substring(openLength).includes('`'))) {
150
>
inFencedBlock = true;
151
>
fenceChar = firstChar;
152
>
fenceLength = openLength;
153
>
unfencedLines.length = 0;
154
>
continue;
155
>
}
156
>
}
157
158
unfencedLines.push(line);