Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Highlight emphasis/strong at the end #204

Merged
merged 1 commit into from
Mar 21, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading