timdp / swirly

A marble diagram generator.
https://swirly.dev
MIT License
118 stars 3 forks source link

Broken operator rendering #36

Closed demensky closed 2 years ago

demensky commented 2 years ago

Code example:

-1-2-3-4-5-|

> tmp(()=>`--|`)

The operator is rendered empty (in SVG also):

diagram


Code example (spaces around =>):

-1-2-3-4-5-|

> tmp(()=>`--|`)

SVG becomes invalid:

Снимок экрана 2022-07-01 в 00 06 30

Can be reproduced at https://swirly.dev/.

timdp commented 2 years ago

Odd, it works for me.

  is a non-breaking space. Swirly replaces regular spaces with non-breaking ones so spaces around observables don't get collapsed. However, it should insert the literal character rather than the named entity code.

This might be browser-specific. I'll experiment with it tomorrow. I might use <pre> instead, so the non-breaking spaces aren't necessary.

demensky commented 2 years ago

I described incorrectly. This problem appears while downloading.

timdp commented 2 years ago

Ah, interesting. I'll look into it.

demensky commented 2 years ago

https://user-images.githubusercontent.com/10235949/176781027-2877782b-2938-47b7-a435-1f58cc90c0ad.mov

timdp commented 2 years ago

This should now be fixed on swirly.dev!