anyproto / anytype-heart

Shared library for Anytype clients
https://anytype.io
Other
236 stars 47 forks source link

Pasting inline math from Wikipedia makes a mess #1350

Open garrettgsb opened 3 months ago

garrettgsb commented 3 months ago

Have you read a contributing guide?

Current Behavior

Copying this text from Wikipedia:

wikipedia-cauchy-distribution

And pasting into AnyType begets this result:

anytype-cauchy-distribution

That is, the text from the mathematical formula is splayed out on multiple lines, and I think a broken SVG embed is included.

Expected Behavior

The text for the math is pasted in as one contiguous unit, similar to how it's rendered on the page.

I can see a few different outcomes that could make sense:

f ( x ; x 0 , γ )

That's how the expression looks when copy-pasted into this field, for example. It looks a little janky, but is tolerable.

Maybe converting to LaTeX is possible, but I wouldn't know how to approach that.

Steps To Reproduce

  1. Create a new page or note in Anytype
  2. Copy the following excerpt from the first paragraph of this Wikipedia page:

The Cauchy distribution f ( x ; x 0 , γ ) {\displaystyle f(x;x{0},\gamma )} is the distribution of the x-intercept of a ray issuing from ( x 0 , γ ) {\displaystyle (x{0},\gamma )} with a uniformly distributed angle. It is also the distribution of the ratio of two independent normally distributed random variables with mean zero.

  1. Paste into the Anytype document
  2. See that the text is messy

Environment

- OS: macOS 12
- Anytype Version: 0.40.9

Anything else?

No response

ra3orblade commented 3 months ago

We will need to fix this when inline-latex arrives.