From fe4f8379767ec5933a6f21aa0ed69aa0200428b9 Mon Sep 17 00:00:00 2001 From: Harry Cordewener Date: Sun, 20 Sep 2026 13:39:11 -0500 Subject: [PATCH 1/4] Add MarkupString.Mxp: MXP's own elements MXP defines more than styling and links -- sounds, images, gauges, status text, frames, variables, expiring links, relocation, the login helpers and the break hints. MxpElements builds each of them, and MxpElement writes one the specification does not define. An element that wraps nothing is a point in the text, carried the way a bell is; one that wraps content marks the text it applies to. A format with no MXP writes nothing at all, the carrier included, so one piece of text is safe to send to every client: a terminal is sent neither a tag it would show as text nor the zero-width space that tag rode on. A browser gets the nearest thing it has -- an img, an audio, a span a page can draw a gauge from -- and only when the element carries an absolute http or https URL of its own, since MXP's FName names a file in the game's own directory that a browser cannot resolve. Whether a client can render an element is a different question, answered by MXP's SUPPORT exchange at the telnet layer; what to do about the answer is the application's. Co-Authored-By: Claude Opus 5 --- CHANGELOG.md | 14 ++ .../MarkupString.AotSmoke.csproj | 2 + MarkupString.AotSmoke/Program.cs | 9 +- .../Emitters/MxpElementEmitter.cs | 71 ++++++ MarkupString.Mxp/Emitters/MxpHtmlEmitter.cs | 155 +++++++++++++ MarkupString.Mxp/MarkupString.Mxp.csproj | 25 ++ MarkupString.Mxp/MxpElement.cs | 101 ++++++++ MarkupString.Mxp/MxpElementCodec.cs | 68 ++++++ MarkupString.Mxp/MxpElements.cs | 218 ++++++++++++++++++ MarkupString.Mxp/MxpRegistration.cs | 30 +++ MarkupString.Mxp/PublicAPI.Shipped.txt | 0 MarkupString.Mxp/PublicAPI.Unshipped.txt | 83 +++++++ MarkupString.Mxp/README.md | 48 ++++ MarkupString.Tests/MarkupString.Tests.csproj | 1 + MarkupString.Tests/Mxp/MxpElementTests.cs | 180 +++++++++++++++ MarkupString.slnx | 1 + README.md | 2 + docs/formats.md | 26 +++ 18 files changed, 1032 insertions(+), 2 deletions(-) create mode 100644 MarkupString.Mxp/Emitters/MxpElementEmitter.cs create mode 100644 MarkupString.Mxp/Emitters/MxpHtmlEmitter.cs create mode 100644 MarkupString.Mxp/MarkupString.Mxp.csproj create mode 100644 MarkupString.Mxp/MxpElement.cs create mode 100644 MarkupString.Mxp/MxpElementCodec.cs create mode 100644 MarkupString.Mxp/MxpElements.cs create mode 100644 MarkupString.Mxp/MxpRegistration.cs create mode 100644 MarkupString.Mxp/PublicAPI.Shipped.txt create mode 100644 MarkupString.Mxp/PublicAPI.Unshipped.txt create mode 100644 MarkupString.Mxp/README.md create mode 100644 MarkupString.Tests/Mxp/MxpElementTests.cs diff --git a/CHANGELOG.md b/CHANGELOG.md index 98093eb..948e0fd 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,20 @@ follows [Semantic Versioning](https://semver.org/spec/v2.0.0.html). ### Added +- **`MarkupString.Mxp`, a new package: MXP's own elements.** `MxpElements` builds what the + specification defines — `SOUND`, `MUSIC`, `IMAGE`, `GAUGE`, `STAT`, `FRAME`, `VAR`, `EXPIRE`, + `RELOCATE`, `USER`, `PASSWORD`, `NOBR`, `SBR` — and `MxpElement` writes one it does not. They render + as MXP tags for `Mxp`, as the nearest thing a browser has for `Html` (an ``, an `