This isn't a comprehensive doc because to our knowledge there are no OSS consumers of this lib, but for posterities sake here are the breaking changes:
After 3 separate attempts to figure out markup support in clues, we've settled on the xd spec compliant version of "markdown with a curly brace."
In the process we've dropped bodyMD
as an optional field on a clue, and switched over to having a "display" field on the clue which should really always be used when presenting a clue for user-facing cases. It is a tuple array indicating how to present chunks of the clue incrementally.
A1. {/Captain/}, {*of*}, {_the_}, ship {-pequod-} {@see here|https://mylink.com@} ~ AHAB
Turns into:
{
"answer": "AHAB",
"body": "{/Captain/}, {*of*}, {_the_}, ship {-pequod-} {@see here|https://mylink.com@}",
"display": [
["italics", "Captain"],
["text", ", "],
["bold", "of"],
["text", ", "],
["underscore", "the"],
["text", ", ship "],
["strike", "pequod"],
["text", " "],
["link", "see here", "https://mylink.com"]
]
}
Also adds "direction" on the clue, it's a tiny micro-optimization, but when you are writing tools which interact with clues, you're often keeping track of this separately - might as well move it inline properly.
A brief sojourn into using BBCode as the markup language for clues.
A chunky re-write of the markdown parser now that it's actually in use at Puzzmo, see the README for an up-to-date look at what we think it should do.
Fixes xd -> JSON -> xd process by converting clue answer to an answer that includes the rebus (if there is one), adding back in pipes/splits (if there are any) and then replacing the rebus symbols back to their word mappings.
Adds a fn for generating semantic diffs between xd crossword files: xdDiff
.
-
The xdparser is now a recoverable parser, what this means is that it will not throw at the first sign of some unexpected input. This means you can't rely on
try {}
to determine if you have a successful parse. Thus: a breaking semver change. -
Added a new
report
object on the JSON response fromxdToJSON
. This will contain any errors or warnings that were encountered during parsing and asuccess
boolean. -
Added the concept of warnings. These are generalized messages which you probably want to act on, but really shouldn't be blocking builds.
-
Added a markdown parser to the clue - we don't make assumptions about the rendering engine and so have a mini-markdown parser in the code base, which gives you a JSON array of the clue's text and formatting. See the README for more.
- Clues from .puz files have newlines stripped out of them
-
Adds support taking an
.xd
and getting it into a format so it can be used with@confuzzle/writepuz
to generate a.puz
file -
Fixes the editor info for the down clues!
- The output for the xd from the app now always uses lowercase keys for the meta section
-
Makes the older hint format of:
A1. Gardener's concerns with A2 and D4. ~ BULB A1. Turned on to illuminate a room. ~ BULB
throw an error. The new format is:
A1. Gardener's concerns with A2 and D4. ~ BULB A1 ^Hint: Turned on to illuminate a room. A1 ^Refs: A2 D4
Includes an auto-migration to a 'hint' which wll be removed with v5 when not in strict mode.
-
Strict mode parsing is also switched to default as 'off' if you don't pass that parameter to
xdToJSON
. -
Converts license from ISC to MIT. ISC is the default for npm projects, but I'm old school and I like MIT. Adds a license file to the root of the project, so that automated tooling can get it.
-
The text for a crossword's clue's field used to be
hint
and now lives inbody
Clue formats changed to handle secondary clue parsing
Shifted the type exports in a way which was breaking but made it easier to have a crossword app extend the types.