Ok. The rules for all this stuff are a little murky, and it's been a while (and I'm not sure I entirely worked out some of it to begin with). But I did put a big section on some of this stuff in the new help system (also coming Real Soon Now™).
First of all, if you are in xch_mode=text
then newlines are left alone; if you are in xch_mode=html
then each newline in the incoming stream is replaced with a <br>
for rendering. (The text
mode also influences whether Pueblo itself will issue <xch_mudtext>
blocks when it wants to insert random HTML of its own. I'm not entirely convinced that the way it chooses to do this actually makes sense, but it's The Way It Has Always Been Done.)
There are basically a couple of different ways to HTMLise a world, AFAIK. The first is minimalist -- leave the mode as text
and keep everything within the initial <xch_mudtext>
block, then wrap any usage of any other HTML tag with </xch_mudtext>
. An important thing to remember when doing this is that the <xch_mudtext>
tag does not
need to be nested "properly" -- it's perfectly legal to do something like this:
abc </xch_mudtext><b><xch_mudtext>123</xch_mudtext></b><xch_mudtext> def
Similarly you can switch in and out of mudtext within anchor tags, or any other tags you like.
The second approach is completist -- issue a </xch_mudtext><img xch_mode="purehtml">
soon after connection, and from then on only emit HTML. This means that you'll have to handle the line breaks and paragraphs yourself. If you want to get monospaced text in this mode, then you can use the <tt>
tags, just like in normal HTML.
(It's probably also worth mentioning that ANSI codes should only be used in the former scenario -- they might do something odd if you use them within HTML mode.)
I'm not entirely sure what the MUSH codebase does by default. Maybe it's trying to be too helpful?
Regarding the last one, that's a little bit worrying; sounds like a bug. So it was left in purehtml-with-mudtext mode when that happened? I suspect that's the fault of the way it tracks which state it's in, which I mentioned in passing above. Maybe I need to take a harder look at that.