Skip to content

Commit

Permalink
pbek/QOwnNotes#3137 table: improve capturing
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 29, 2024
1 parent 6a28fdd commit 8197580
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions markdownhighlighter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -173,9 +173,10 @@ void MarkdownHighlighter::initHighlightingRules() {
{
HighlightingRule rule(HighlighterState::Table);
rule.shouldContain = QStringLiteral("|");
// Support up to 3 spaces before the table because md4c seems to support that
// Support up to 3 leading spaces, because md4c seems to support it
// See https://github.com/pbek/QOwnNotes/issues/3137
rule.pattern = QRegularExpression(QStringLiteral("^\\s{0,3}\\|.+?\\|$"));
rule.pattern = QRegularExpression(QStringLiteral("^\\s{0,3}(\\|.+?\\|)$"));
rule.capturingGroup = 1;
_highlightingRules.append(rule);
}
}
Expand Down

0 comments on commit 8197580

Please sign in to comment.