diff --git a/CHANGELOG.md b/CHANGELOG.md index 68b2b6f5c8..9bbc564736 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,8 @@ ## 25.1.6 - The available AI models for Groq have been updated (for [#3216](https://github.com/pbek/QOwnNotes/issues/3216), thank you, @Weej1) +- An issue with combinations or strong and em tags preview was fixed + (for [#3218](https://github.com/pbek/QOwnNotes/issues/3218)) ## 25.1.5 - After moving a note to a new subfolder, outgoing links to other notes can now be diff --git a/src/utils/schema.cpp b/src/utils/schema.cpp index 65f7dd760e..4896c2f695 100644 --- a/src/utils/schema.cpp +++ b/src/utils/schema.cpp @@ -399,8 +399,17 @@ QString Utils::Schema::getSchemaStyles() { schemaStyles += encodeCssStyleForState(MarkdownHighlighter::H5, QStringLiteral("h5")); schemaStyles += encodeCssStyleForState(MarkdownHighlighter::H6, QStringLiteral("h6")); schemaStyles += encodeCssStyleForState(MarkdownHighlighter::Link, QStringLiteral("a")); - schemaStyles += encodeCssStyleForState(MarkdownHighlighter::Bold, QStringLiteral("b, strong")); - schemaStyles += encodeCssStyleForState(MarkdownHighlighter::Italic, QStringLiteral("i, em")); + + // We are adding also style combinations for bold and italic, because QTextBrowser doesn't + // inherit the styles correctly (https://github.com/pbek/QOwnNotes/issues/3218) + schemaStyles += encodeCssStyleForState( + MarkdownHighlighter::Bold, + QStringLiteral( + "b, strong, i b, em b, i strong, em strong, b i, strong i, b em, strong em")); + schemaStyles += encodeCssStyleForState( + MarkdownHighlighter::Italic, + QStringLiteral("i, em, i b, em b, i strong, em strong, b i, strong i, b em, strong em")); + schemaStyles += encodeCssStyleForState(MarkdownHighlighter::CodeBlock, QStringLiteral("code, pre > code, pre")); schemaStyles += encodeCssStyleForState(MarkdownHighlighter::InlineCodeBlock, @@ -463,7 +472,7 @@ QString Utils::Schema::encodeCssStyleForState(MarkdownHighlighter::HighlighterSt // Allow italic inside bold tags, like `**bold *and italic***` // https://github.com/pbek/QOwnNotes/issues/3218 - // Unfortunately, the QTextBrowser still doesn't render it correctly + // Unfortunately, that's not enough for the QTextBrowser to render it correctly if (index == MarkdownHighlighter::Italic) { cssString.remove(QStringLiteral("font-weight: normal;")); }