Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
Add LaTeX support #3679
Add LaTeX support #3679
Changes from all commits
453a673
11c23b8
41b1e3d
3649bc4
6270550
cb9dc8a
3e00126
d03307f
a698d7b
6adc19e
45783c2
c620326
b2dc5e9
63a7bc9
dda99e9
a31cbcb
4f51f6a
dd73b2d
b028728
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
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 don't quite follow this. What does it look like?
Or: Huh, how would you give it to some part inside the fragment?
... Oh, I see, the answer to the latter question is in
fixup-katex.js
.I would not call that a "naïve solution". 😛
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.
That's understandable; I seem to have left out an entire paragraph. 😞 The bit in
fixup-katex.js
is not the naïve solution; it's the one that actually works.(One would give scrollability to some part inside the fragment by adding a CSS rule
.katex-display > .katex { overflow-x: auto; }
or somesuch.)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, I see.
I still don't quite follow the description of the problem/symptom. What does it look like when margin collapsing no longer works?
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've added a few words here, but there's really no way I can get this across without including an image – which I doubt would be helpful to future readers or debuggers.
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.
Bump -- I think the added few words may have gone missing :-) because this appears to be the same as of b028728 as it is in the code at the start of this subthread.
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.
Use px values, following our style elsewhere; preferably multiples of 4px.
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.
For this one, I'd prefer to follow KaTeX's style, because this overrides a KaTeX CSS definition.
(That's worth a note, though.)
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.
That's informative, thanks.
Thinking more about this, I really do want it to follow our style. (Policy? I said "style" originally but as I'm rereading what we have on this I realize that's inadequate -- it makes a visible difference, and overuse of
em
is an accessibility issue.) There are good reasons for that style^W policy, and we can't (within reasonable effort) control how third-party libraries work but we can keep things 100% consistent within our own code.And in this case, to the extent there's a clash between our usage and the one in KaTeX's CSS, I don't think the result is materially worse if this rule is on our side of the clash rather than KaTeX's; I expect it works out better, for the same reasons that our usage is preferable in general.
I'm also finding as I look at this that the writeups we have of the reasoning here are a bit scattered and not entirely satisfying. So I'll go and pull those together into a better doc, which hopefully will be helpful.
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.
Started that writeup as I entered this comment (just before the holiday), and went back and finished it just now: 78d57a2 or https://github.com/zulip/zulip-mobile/blob/master/docs/background/webview.md . PTAL!
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.
(Any followup discussion is probably best in a chat thread, rather than attempting to squeeze it in here.)
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.
Huh, is this true in general? Or do you mean for this particular query?
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.
This is true in general!
root.querySelectorAll(...)
never returnsroot
as one of its values.(It looks like it also doesn't return nodes from shadow DOM subtrees, although I admit I hadn't considered that at the time.)
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 see. Because it only returns descendants, and "descendant" is defined to exclude the ancestor itself.
As always, when I ask a question in code review because I'm confused, I would like the confusion cleared up in the branch itself. :-)
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.
bump
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 it's worked well to keep these all in the one root .gitignore file. Separate files can be helpful for organization, but when the separate file is so tiny like this there isn't much of that benefit.
Here, this would very naturally go in the stanza
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.
It's tiny today, but I expect it to grow soon.
I also don't think the root
.gitignore
file is working very well, and that third line you posted is evidence of it:android/app/build
is only covered by chance, due to a line in the section labeled# Xcode
! If not for the comment in there about upgrading React Native, I'd already be inclined to break out theios/
- andandroid/
-specific elements into subfiles.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.
In that case we can easily split it out when it does 🙂 It's super easy to move these lines around, and meanwhile we can avoid paying the cost of having things fragmented in tiny files.
I don't think the other bit is something that would be improved by splitting the file into tiny pieces. I started writing a longer reply, but this thread isn't the right format for that. I think it'd be reasonable to assimilate the whole file to a style that's explicit about rooted vs. unrooted patterns, and to our own choice of organizing it; a good place to discuss that would be a chat thread.
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.
No need to block this on having that discussion, though. Removed, assimilated, and amended.
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.
Sounds good! But I think this intended change may have gone missing.