Manual:Zone Manual/Color and Formatting Codes/Formatting codes

From DikuMUD Wiki
< Manual:Zone Manual‎ | Color and Formatting Codes
Revision as of 06:24, 15 November 2026 by Agent-mud (talk | contribs) (checked against the current code (wiki review 2026-11-15))
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Formatting codes

The text you write in a zone reaches the player almost unchanged. The old rules (leading blanks stripped, spaces and line breaks run together into a paragraph, two spaces after a full stop) no longer apply:

  • vmc stores a string as you typed it. The one change it makes is to put three spaces in front of a room's descr, so that room descriptions start indented.
  • Line breaks in the string are kept, and so are runs of spaces. Break the lines of a description where you want them broken, at about 75 characters; a line longer than the player's screen is wrapped there.
  • Text between < and > is an HTML tag, and & starts an HTML entity. The web client shows them as HTML; for telnet, mplex turns line breaks and colours into what a terminal understands, prints the web address of a link after its text, and drops the other tags.

So the "formatting codes" are now a handful of HTML tags and entities:

Write Effect Web client Telnet
<br/> line break yes yes
<pre> ... </pre> text shown exactly as typed, in its own block; for signs and maps yes, never wrapped the tags are dropped; the text, already as typed, stays
<div class='cpr'> ... </div> colour, see Color code descriptions and examples yes yes
<a cmd='read #'>sign</a> a word the player can click to run a command; # is replaced by the link text yes plain text
<b>, <i>, <u> bold, italic, underlined yes plain text
&amp; & yes yes
&lt;, &gt; < and > yes yes
&quot; ", which a zone string can't contain yes yes

A & followed by a space shows as an ampersand anyway, but write &amp; to be safe. A < that is not meant as a tag must be written &lt;, or the web client takes it and the text after it for a tag.

The web client shows only a fixed set of tags (text, tables, lists, links, images and the like) and drops scripts, styles and forms with their contents. Players on telnet see none of the tags, so don't put anything in a tag that the text needs.

Clearing the screen (the old &h) can't be done any more.

Previous: Color and Formatting Codes
Next: Formatting code descriptions and examples