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

[BUG] Italics nested in bold are not bold in preview #3218

Closed
athyfr opened this issue Jan 27, 2025 · 10 comments
Closed

[BUG] Italics nested in bold are not bold in preview #3218

athyfr opened this issue Jan 27, 2025 · 10 comments
Labels
Severity: Low Bugs or breaking changes with low impact Type: Bug Type: Upstream-problem

Comments

@athyfr
Copy link

athyfr commented Jan 27, 2025

Expected behaviour

Italics and bold combine when italics are nested inside bold.

Like this example (rendered using GitHub Markdown): **bold *and italic*** -> bold and italic

Actual behaviour

The nested italic just looks like regular italic (in the preview window):

Image

It looks fine in the editor, though.

Steps to reproduce

Steps to reproduce the behavior:

Copy and paste this text (**bold *and italic***) to a note in QOwnNotes, and look at the preview window.

It looks fine in the editor, but not the preview window.

Proposed solution

Separate the theming for 'bold & italic' from 'bold' and 'italic' in the editor theming.

Another popular note-taking app (Obsidian) uses this approach, which I find works quite well.

It also allows for the combination to have a different color than either others, which would allow for more freedom.

@pbek
Copy link
Owner

pbek commented Jan 28, 2025

The generated HTML is correct, <strong>bold <em>and italic</em></strong>, but the CSS styles for em are setting font-weight normal.

@Waqar144, can you maybe remember something about that?

@pbek pbek changed the title [BUG] Italics nested in bold are not bold [BUG] Italics nested in bold are not bold in preview Jan 28, 2025
@Waqar144
Copy link
Contributor

This used to work IIRC. The style needs to be merged with existing style. So if bold exists, the italic should merge with bold instead of overwriting. This is definitely a markdownhighlighter bug

@pbek
Copy link
Owner

pbek commented Jan 28, 2025

Thank you. The highlighting in the editor works in the way it should, it's only the preview. I'll look into it.

@pbek pbek added Type: Bug Severity: Low Bugs or breaking changes with low impact and removed Type: Support labels Jan 28, 2025
pbek added a commit that referenced this issue Jan 28, 2025
Signed-off-by: Patrizio Bekerle <patrizio@bekerle.com>
@pbek
Copy link
Owner

pbek commented Jan 28, 2025

I fixed the CSS styles, but the QTextBrowser still is rendering the combination wrong.

@pbek
Copy link
Owner

pbek commented Jan 28, 2025

By adding styles for all permutations i b, em b, i strong, em strong, b i, strong i, b em, strong em I was able to get around the QTextBrowser issue!

@pbek
Copy link
Owner

pbek commented Jan 28, 2025

Image

pbek added a commit that referenced this issue Jan 28, 2025
Signed-off-by: Patrizio Bekerle <patrizio@bekerle.com>
@pbek
Copy link
Owner

pbek commented Jan 28, 2025

25.1.6

  • An issue with combinations of strong and em tags preview was fixed
    (for #3218)

pbek added a commit that referenced this issue Jan 28, 2025
Signed-off-by: Patrizio Bekerle <patrizio@bekerle.com>
@pbek
Copy link
Owner

pbek commented Jan 28, 2025

There now is a new release, could you please test it and report if it works for you?

@athyfr
Copy link
Author

athyfr commented Jan 28, 2025

It works now, thanks!:

Image

I'll close the issue.

I was amazed by the fast response times, and look forward to exploring your app further, thanks!

@athyfr athyfr closed this as completed Jan 28, 2025
@pbek
Copy link
Owner

pbek commented Jan 28, 2025

Great, thank you for testing! 😉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Severity: Low Bugs or breaking changes with low impact Type: Bug Type: Upstream-problem
Projects
None yet
Development

No branches or pull requests

3 participants