ZMYaro / paintz

A simple drawing app that runs in a web browser, designed to be an MS Paint substitute for Chromebooks and other Chrome OS devices. PaintZ is free, but please consider supporting development at https://ko-fi.com/ZMYaro or https://patreon.com/ZMYaro.
https://paintz.app
53 stars 11 forks source link

Text boxes fail to rasterize if the text starts with a space #140

Closed ZMYaro closed 5 years ago

ZMYaro commented 5 years ago

Describe the bug If the text in a text box is preceded by a space, the text box will vanish when committed and not be rasterized to the canvas. No error is thrown.

Steps to reproduce the behavior

  1. Switch to the text tool.
  2. Create a text box.
  3. Type some text that is preceded by a space.
  4. Click away to rasterize the text.
  5. The text box disappears and no rasterized text appears.

Expected behavior The text should have been rasterized to the canvas.

ZMYaro commented 5 years ago

When the text box's inner HTML is grabbed, the preceding space is a non-breaking space entity,  , but that entity is not defined in XML, so the SVG has an error in it and will not render.