Open Blind4Basics opened 2 years ago
The first one is caused by katex.min.css
not included on that page, so the preview is showing elements that's supposed to be hidden by it.
I think the second one has something to do with KaTeX outputting HTML and MathML (for accessibility). Selecting a paragraph copies both text? Not sure about this one.
Selecting a paragraph copies both text?
from the same kata/description, copying in the trainer:
// copying the full line (which is a §):
The starting point A0(x0,y0) A_0 (x_0, y_0) A0(x0,y0) is known as well as the slope to the curve at A0 A_0 A0 and then the tangent line at A0 A_0 A0 .
// copying a full § with extra text before and after:
−2x.
For each xk x_k xk we are able to calculate the yk y_k yk as well as the values zk z_k zk of the exact solution.
Our task
It looks like the $
"tags" were replaced by the expression itself (makes me think to regex matches)
It shouldn't have anything to do with the original input text because only the text inside $
and math
block are passed to KaTeX.
Look at the HTML it generated. It should have mathml
and some span
s. I thought selecting a paragraph selects both of them and the text content is copied.
The first one should be fixed.
Using the copy-tex
extension should fix the second issue. But it doesn't work properly on Codewars because we use DOMPurify
to sanitize the generated HTML, and <annotation>
element used by that extension is filtered because it can be unsafe (https://github.com/cure53/DOMPurify/issues/673).
Not sure what can be done.
as long as the vizual is ok, I guess it can stay like this...
Describe the bugs
Not sure if it's old or new, but the renderer is litterally acting, here:
[x] when previewing a description (I'm forking a kata, in the capture below) all katex expressions are tripled. This occurs with any kind of katex expressions (inline and blocks)
[ ] I got similar problems when solving a kata. I did a copy/paste from a description to the editor in a trainer: the description looks fine, but once the selected text has been pasted, I got triplets of it in the trainer in some situations. It looks like it happens only when copying inline katex expressions. Example here (warning: trainer link!) https://www.codewars.com/kata/56347fcfd086de8f11000014/train/typescript
A0(x0,y0)
(3rd §) and paste in the trainer => triplets:A0(x0,y0) A_0 (x_0, y_0) A0(x0,y0)
NOTE:
once the fork is published, the description looks fine (but cause the copy/paste troubles)
┆Issue is synchronized with this Clickup by Unito