imdone-core 1.53.6 → 1.53.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -225,9 +225,27 @@ function getTextFileTaskContent ({
|
|
|
225
225
|
const rawTaskContentLines = []
|
|
226
226
|
const taskContentLines = []
|
|
227
227
|
|
|
228
|
+
let inCodeBlock = false
|
|
229
|
+
let inCodeSpan = false
|
|
230
|
+
|
|
228
231
|
for (let i = 1; i < lines.length; i++) {
|
|
229
232
|
let line = lines[i]
|
|
230
|
-
|
|
233
|
+
|
|
234
|
+
// Check for markdown code blocks
|
|
235
|
+
if (isMarkDownFile && line.trim().startsWith('```')) {
|
|
236
|
+
inCodeBlock = !inCodeBlock
|
|
237
|
+
}
|
|
238
|
+
|
|
239
|
+
// Check for markdown code spans
|
|
240
|
+
if (isMarkDownFile && line.includes('`')) {
|
|
241
|
+
const codeSpanMatches = line.match(/`+/g)
|
|
242
|
+
if (codeSpanMatches && codeSpanMatches.length % 2 !== 0) {
|
|
243
|
+
inCodeSpan = !inCodeSpan
|
|
244
|
+
}
|
|
245
|
+
}
|
|
246
|
+
|
|
247
|
+
// Only break if the task is not in a markdown code block or code span
|
|
248
|
+
if (!inCodeBlock && !inCodeSpan && hasTaskInText(config, line)) break
|
|
231
249
|
if (isCheckBoxTask(config, line, beforeText)) break
|
|
232
250
|
if (isTaskInList && isLineOutsideMarkdownList(line, beforeText)) break
|
|
233
251
|
if (isCustomCardTerminator(config, line)) break
|
package/lib/file.js
CHANGED
|
@@ -381,7 +381,7 @@ File.prototype.extractHashStyleTasks = function (config, pos, content) {
|
|
|
381
381
|
if (!config.listExists(list)) continue
|
|
382
382
|
|
|
383
383
|
const posInContent = result.index + pos
|
|
384
|
-
if (this.isWithinCodeSpanOrBlock(
|
|
384
|
+
if (this.isWithinCodeSpanOrBlock(result.index, content)) continue
|
|
385
385
|
|
|
386
386
|
const line = this.getLineNumber(posInContent)
|
|
387
387
|
if (this.hasTaskAtLine(line)) continue
|
|
@@ -416,7 +416,7 @@ File.prototype.extractLinkStyleTasks = function (config, pos, content) {
|
|
|
416
416
|
let [match, before, rawTask, text, list, colon, order] = result
|
|
417
417
|
const beforeLength = before ? before.length : 0
|
|
418
418
|
const posInContent = result.index + pos + beforeLength
|
|
419
|
-
if (this.isWithinCodeSpanOrBlock(
|
|
419
|
+
if (this.isWithinCodeSpanOrBlock(result.index, content)) continue
|
|
420
420
|
var line = this.getLineNumber(posInContent)
|
|
421
421
|
if (self.hasTaskAtLine(line)) continue
|
|
422
422
|
if (!config.listExists(list)) continue
|