mirror of
https://github.com/zulip/zulip.git
synced 2026-07-21 21:05:48 +08:00
We've for a while been finding that copy/paste of LaTeX only worked if we had a more JS-heavy copy handler that directly copies the HTML/text using events, rather than just allowing the browser's native copying logic to do its thing. We've discovered the bug was that the `<annotation>` tag in MathML is not rendered in some browsers which results in default copy behavior of the browser breaking KaTeX copy-pasting and quoting by omitting the `<annotation>` in the copied HTML as Chrome and possibly other browsers select only what is visible. From https://www.w3.org/TR/selection-api/ > Chrome 16 dev behaves as you'd expect given its Selection implementation. It refuses to select anything that's not visible, so it's almost always wrong. Opera 11.50 just does nothing in all my tests, as usual. This can be observed in the `paste_html` fixtures present in https://github.com/zulip/zulip/pull/33993#issuecomment-2725417637. We fix this by simply overriding the `display:none` property from the <annotation> tag in the user agent stylesheet, which lets the browser select and ultimately copy it which results in the annotation being present in the `paste_html` and restore the working of KaTeX quoting/copy-pasting. This appears to have no visible impact, since browsers don't actually have a way to display the annotations. |
||
|---|---|---|
| .. | ||
| portico | ||
| alerts.css | ||
| app_components.css | ||
| app_variables.css | ||
| banners.css | ||
| buttons.css | ||
| color_picker.css | ||
| components.css | ||
| compose.css | ||
| dark_theme.css | ||
| drafts.css | ||
| image_upload_widget.css | ||
| inbox.css | ||
| informational_overlays.css | ||
| input_pill.css | ||
| left_sidebar.css | ||
| lightbox.css | ||
| message_edit_history.css | ||
| message_header.css | ||
| message_row.css | ||
| message_view_header.css | ||
| modal.css | ||
| popovers.css | ||
| print.css | ||
| progress_bar.css | ||
| pygments.css | ||
| reactions.css | ||
| recent_view.css | ||
| rendered_markdown.css | ||
| right_sidebar.css | ||
| scheduled_messages.css | ||
| search.css | ||
| settings.css | ||
| subscriptions.css | ||
| tooltips.css | ||
| typeahead.css | ||
| typing_notifications.css | ||
| user_circles.css | ||
| user_status.css | ||
| widgets.css | ||
| zulip.css | ||