diff --git a/frontend/app.js b/frontend/app.js index e560858..e1d3ae4 100644 --- a/frontend/app.js +++ b/frontend/app.js @@ -2968,8 +2968,8 @@ function noteApp() { // List items: lines starting with -, *, + or a number (e.g. 1., 10.), excluding tasks [-] const listItems = (content.match(/^\s*(?:[-*+]|\d+\.)\s+(?!\[)/gm) || []).length; - // Tables: separator rows containing both '|' and '---' - const tables = (content.match(/^(?=.*\|)(?=.*---).*$/gm) || []).length; + // Tables: markdown table separator rows (| --- | --- |) + const tables = (content.match(/^\s*\|(?:\s*:?-+:?\s*\|){1,}\s*$/gm) || []).length; // Link count const linkMatches = content.match(/\[([^\]]+)\]\(([^\)]+)\)/g) || []; diff --git a/plugins/note_stats.py b/plugins/note_stats.py index d3972d0..d1ebdb9 100644 --- a/plugins/note_stats.py +++ b/plugins/note_stats.py @@ -49,9 +49,9 @@ class Plugin: re.findall(r'^\s*(?:[-*+]|\d+\.)\s+(?!\[)', content, re.MULTILINE) ) - # Tables: count separator rows containing both '|' and '---' + # Tables: count markdown table separator rows (| --- | --- |) tables = len( - re.findall(r'^(?=.*\|)(?=.*---).*$', content, re.MULTILINE) + re.findall(r'^\s*\|(?:\s*:?-+:?\s*\|){1,}\s*$', content, re.MULTILINE) ) # Markdown link count