erkyrath / glkote

A Javascript display library for IF interfaces
http://eblong.com/zarf/glk/glkote.html
MIT License
26 stars 11 forks source link

Remove NBSP characters so the input is not displaced #72

Closed vmiliantsei closed 2 months ago

erkyrath commented 2 months ago

I think this is about the case where there is no prompt -- input begins on an empty line. In that case, the input element is not left-flush because of the NBSP in the paragraph.

erkyrath commented 2 months ago

Ugh, this is a tricky one. The problem is real (input lines shift to the left when you hit enter). But the proposed fix messes up copy-and-paste. The empty-inline-block span doesn't collapse, but it doesn't copy as a newline either. So copied game output is wrong.

erkyrath commented 2 months ago

I think the solution is CSS to suppress the placeholder space (display:none it) when it's followed by an input element.

I changed the NBSP to a regular space, since we have white-space:pre-wrap these days.

(But I only touched buffer windows. Grid windows still use NBSP because hey, no known problems there.)