-
Notifications
You must be signed in to change notification settings - Fork 325
content: Include inline styles (italic etc.) in what we pass to WidgetSpans #1821
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
base: main
Are you sure you want to change the base?
content: Include inline styles (italic etc.) in what we pass to WidgetSpans #1821
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for doing this @chrisbobbe! LGTM, couple of small comments below.
lib/widgets/katex.dart
Outdated
// Remove link color, but | ||
// TODO(design) do we want to do that? | ||
color: baseColor, | ||
// italic and strikethrough are removed below, but |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm, I did a quick test and it looks like strikethrough seems to work:
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah yeah that's right:
- The strikethrough is not applied to the katex in the WidgetSpan
- …but it is applied to an ancestor span, and the inline-katex implementation doesn't obscure it by setting an opaque background :) so it shows through
lib/widgets/katex.dart
Outdated
// Just for completeness, remove "wght", but it wouldn't do anything anyway | ||
// since KaTeX_Main is not a variable-weight font. | ||
fontVariations: [], | ||
// Remove link color, but |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like web client currently applies the link color over inline TeX, so we probably want to handle it similarly.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Filed #1823 for that, so probably add a TODO pointing to that.
In the inline-math case, we're about to pass the actual ambient text style, which may have italic, strikethrough, bold, or link formatting. Consolidate the code that overrides each of those, so that it reads as intentional, and add TODOs for overrides that we might not want to keep.
…tSpans Fixes zulip#1813. Fixes zulip#1819. This is NFC for inline math, since all the inline styles are overridden there. But see the previous commit for where we consolidated those overrides, making a natural place to add more if needed in the future, with TODOs for some existing ones we might not want to keep.
f24d250
to
8310d37
Compare
Thanks! Revision pushed, expanding the comment about strikethrough and adding a commit for #1823. Here are screenshots before and after that new commit:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @chrisbobbe! LGTM, moving over to Greg's review.
Fixes #1813.
Fixes #1819.
Fixes #1823.
I've left out further testing because we have other pressing priorities; please let me know if something's missing or not well-explained.