-
Notifications
You must be signed in to change notification settings - Fork 320
katex: Remove renderKaTex experimental flag #1742
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
katex: Remove renderKaTex experimental flag #1742
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 cleaning this up! Generally all looks good; small comments below.
}, skip: true // TODO(#46): adapt this test | ||
// (it needs a more complex targetFontSizeFinder; | ||
// see other uses in this file for examples.) |
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.
nit:
content test [nfc]: Drop duplicate skipped KaTeX font-size ratio test
rather, it's a skipped duplicate such test — there's another KaTeX font-size ratio test, which this is a duplicate of, but there's no other skipped KaTeX font-size ratio test, so it can't be a duplicate within that category.
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.
Also please add a sentence to the commit message clarifying that the existing test this duplicates is the one above it, not the one below. I initially read it as the latter (because the descriptions match — my conflict-resolution error, probably, somewhere in the chain of cherry-picking that led to b073c6b / #1270), and was going to comment that it's not actually a duplicate of that 🙂
}); | ||
|
||
testWidgets('displays KaTeX content; experimental flag enabled', (tester) async { |
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.
nit: make summary line more specific
content test [nfc]: Reorder KaTeX widget tests
With renderKatex flag enabled (and soon to be default behaviour)
being first.
There's room in that summary line to put some of that information from the body, to give an idea of what the reordering is about. Like:
content test [nfc]: Reorder KaTeX widget tests, enabled before disabled
test/model/content_test.dart
Outdated
static final mathInlineUnknown = ContentExample.inline( | ||
'inline math', | ||
r"$$ \lambda $$", |
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.
Since this HTML isn't something the server actually generates, this markdown
field should be null. See its doc:
/// The Zulip Markdown source, if any, that the server renders as [html].
///
/// This is useful for reproducing the example content for live use in the
/// app, and as a starting point for variations on it.
///
/// Currently the test suite does not verify the relationship between
/// [markdown] and [html].
///
/// If there is no known Markdown that a Zulip server can render as [html],
/// then this should be null and a comment should explain why the test uses
/// such an example.
final String? markdown;
So e.g., following the example emojiUnicodeClassesFlipped
:
static final mathInlineUnknown = ContentExample.inline( | |
'inline math', | |
r"$$ \lambda $$", | |
static final mathInlineUnknown = ContentExample.inline( | |
'inline math', | |
null, // r"$$ \lambda $$" (hypothetical server variation) |
test/widgets/content_test.dart
Outdated
await globalSettings.setBool(BoolGlobalSetting.renderKatex, false); | ||
|
||
const html = '<span class="katex">' | ||
testWidgets('maintains font-size ratio with surrounding text, when fallback to TeX source', (tester) async { |
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.
nit: "fallback" is a noun, "fall back" the verb:
testWidgets('maintains font-size ratio with surrounding text, when fallback to TeX source', (tester) async { | |
testWidgets('maintains font-size ratio with surrounding text, when falling back to TeX source', (tester) async { |
a52a1e2
to
8ad5c0d
Compare
Thanks for the review @gnprice! Pushed an update, PTAL. |
test/model/content_test.dart
Outdated
static final mathInline = ContentExample.inline( | ||
'inline math', | ||
r"$$ \lambda $$", | ||
null, // r"$$ \lambda $$" (hypothetical server variation) |
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.
I think you made this edit on a different example than intended 🙂
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.
Ahh, should be fixed now.
3187f68
to
ccf262f
Compare
Thanks for the review @gnprice! Pushed an update, PTAL. |
This skipped test is a duplicate of the one above it, but incorrectly has the description of the one below it. Probably a result of conflict-resolution error in b073c6b which introduced this duplicate, or another in the chain of cherry-picks that led to that commit.
With renderKatex flag enabled (and soon to be default behaviour) being first.
This flag has been enabled since v0.0.29 (beta) release, and we don't plan to disable it. So remove the flag completely, simplifying related code. Fixes: zulip#1728
Thanks! Merging, with a tweak in one commit message (cf #1742 (comment)):
|
ccf262f
to
da5c1f7
Compare
This flag has been enabled since v0.0.29 (beta) release, and we don't plan to disable it. So remove the flag completely, simplifying related code.
Fixes: #1728