mainsail-crew / mainsail

Mainsail is the popular web interface for managing and controlling 3D printers with Klipper.
https://docs.mainsail.xyz
GNU General Public License v3.0
1.63k stars 341 forks source link

Consecutive and leading whitespace is not shown in console output #1895

Closed rschaeuble closed 1 month ago

rschaeuble commented 1 month ago

Mainsail Version:

2.11.2

Browser:

Chrome

Device:

Desktop PC

Operating System:

macOS

What happened?

Define this macro to reproduce:

[gcode_macro TEXT_WITH_WHITESPACE]
gcode:
  {action_respond_info("|123|")}
  {action_respond_info("|   |")}
  {action_respond_info("   |   |")}

Expected output:

|123|
|   |
   |   |

Actual output:

|123|
| |
| |

The reason is that HTML by default collapses whitespace. By adding white-space: pre-wrap, this can be avoided.

What did you expect to happen instead?

See above

How to reproduce this bug?

See above

Additional information:

No response