r25970 - Force html to wrap, add support for the html attribute "title" in CLI & Chat by

I think this has affected my monospaced output. I used to have scripts that output aligned monospaced characters, and they're no longer aligned. This is the only thing I can see that would change that; I've not altered my system fonts or anything else in any way.
 

heeheehee

Developer
Staff member
From some poking around: <pre> is broken, but <font> and inline CSS (e.g. <span style="font-family:monospace">...</span>) both work.
 
I use 'print_html', which up to now has produced monospaced output.
Ah, the <tt> tag. Either way -- https://github.com/kolmafia/kolmafia/pull/315 should fix this issue.
I've figure it out. I have runs of spaces that are now being converted to single spaces.
print_html("<tt>Test ___run_of_spaces_ for monospace</tt>");
produces the same as
print_html("<tt>Test for monospace</tt>");


EDIT:

No I don't. My script has
toPrint = replace_string(toPrint, " ", "&nbsp;");
before each print_html, so that's odd. This only happened with the new version.
 

heeheehee

Developer
Staff member
Did that work previously? I tried checking out r25960 and ran
Code:
> ash print_html("<tt>mono    space</tt>")

mono space
Returned: void
 

heeheehee

Developer
Staff member
If I write
Code:
print_html("<pre>mono      space</pre>");
in a script, that's preserved as expected. But in the CLI input box, that gets stripped.
 
If I write
Code:
print_html("<pre>mono      space</pre>");
in a script, that's preserved as expected. But in the CLI input box, that gets stripped.
No, I see I've been converting spaces to non-breaking spaces. Funny to come back to a script a year or so old and find out what you did...

Either way, I don't want monospaced output wrapped in the CLI; it breaks my carefully-produced, pretty ASCII renderings of things. How can I stop it?
 

heeheehee

Developer
Staff member
As implemented, you can't. We could easily add a preference for "hey I really don't want text wrapping".

Why do you want ascii art that goes beyond the edge of the text box? Can you just make your window wider?
 
When I'm playing the game I have three windows open; the browser, the cli and the main window with various tabs in. They fit nicely on my screen, and it's how I like them. They've been like it for years, and it rather suits me. Which all seems very ungrateful, I'm sure, when you've spent a long time making everything wrap, but I was quite happy with how things were, and don't really want to have to make the CLI bigger or, in fact, change the way I play at all.

My 'luxury output' script basically makes big titles using monospaced blocks, like the old ASCII-text art. I use it so I can find things quickly in the logs, and so I can easily see things in the CLI.

As I say, it all worked fine up until today, and I was rather happy with how things were. I'd love a way to turn the text wrapping back off for monospaced output.

I do believe it's also used for things like displaying the mushroom fields in similar scripts. That functionality is also going to be destroyed by wrapping. Some output depends on monospacing and no-wrap, basically.
 

heeheehee

Developer
Staff member
Which all seems very ungrateful, I'm sure, when you've spent a long time making everything wrap
(I actually don't have a horse in this race, as I didn't implement this logic initially.)

It's basically just a three-line change, to let people opt out of it, although it might have some performance implications. Eh, we'll see if that's actually an issue in practice.
 

heeheehee

Developer
Staff member
Specifically: it's easy to turn the text wrapping on/off globally. It's probably harder to turn it on/off for monospaced text specifically, and I'm not sure how best to do that without checking the font in use.
 

heeheehee

Developer
Staff member
Hm. It looks like text wrapped in <pre> tags won't wrap no matter what, and will actually change the wrap target for the rest of your CLI contents. Either way, I guess if people really want that feature, they can have it.
 
Top