Skip to content

Commit

Permalink
pbek/QOwnNotes#3137 table: support up to 3 leading spaces
Browse files Browse the repository at this point in the history
Signed-off-by: Patrizio Bekerle <patrizio@bekerle.com>
  • Loading branch information
pbek committed Oct 28, 2024
1 parent 000cc72 commit 6a28fdd
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion markdownhighlighter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,9 @@ void MarkdownHighlighter::initHighlightingRules() {
{
HighlightingRule rule(HighlighterState::Table);
rule.shouldContain = QStringLiteral("|");
rule.pattern = QRegularExpression(QStringLiteral("^\\|.+?\\|$"));
// Support up to 3 spaces before the table because md4c seems to support that
// See https://github.com/pbek/QOwnNotes/issues/3137
rule.pattern = QRegularExpression(QStringLiteral("^\\s{0,3}\\|.+?\\|$"));
_highlightingRules.append(rule);
}
}
Expand Down

0 comments on commit 6a28fdd

Please sign in to comment.