Skip to content

Commit

Permalink
Highlight emphasis/strong at the end
Browse files Browse the repository at this point in the history
Should fix QOwnNotes #2952

Didn't test it a lot so there might still be issues
  • Loading branch information
Waqar144 authored and pbek committed Mar 21, 2024
1 parent 6dc71db commit 35330ea
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions markdownhighlighter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1896,8 +1896,6 @@ int isInLinkRange(int pos, QVector<QPair<int, int>> &range) {
* underlines, strikethrough, links, and images.
*/
void MarkdownHighlighter::highlightInlineRules(const QString &text) {
bool isEmStrongDone = false;

// clear existing span ranges for this block
auto it = _ranges.find(currentBlock().blockNumber());
if (it != _ranges.end()) {
Expand All @@ -1913,14 +1911,12 @@ void MarkdownHighlighter::highlightInlineRules(const QString &text) {
} else if (currentChar == QLatin1Char('<') &&
MH_SUBSTR(i, 4) == QLatin1String("<!--")) {
i = highlightInlineComment(text, i);
} else if (!isEmStrongDone && (currentChar == QLatin1Char('*') ||
currentChar == QLatin1Char('_'))) {
highlightEmAndStrong(text, i);
isEmStrongDone = true;
} else {
i = highlightLinkOrImage(text, i);
}
}

highlightEmAndStrong(text, 0);
}

// Helper function for MarkdownHighlighter::highlightLinkOrImage
Expand Down

0 comments on commit 35330ea

Please sign in to comment.