Skip to content

Releases: haruhimemoe/bbcode

v0.2.2

Choose a tag to compare

@dvhsh dvhsh released this 29 Sep 01:47
d111e72

Added

  • OSU_WIDTHS (userpage 890, forum 750, beatmap 430) and OSU_FONT_SIZES (14, 14, 12): the column width and font size, in px, osu! shows BBCode at on desktop. A preview drawn at these and scaled to fit wraps lines and image rows where osu! does.

Changed

  • styles.css spaces boxes as osu! does: the body sits 10px under the title, indented 20px, without the rule beside it, and the title's text lines up with the body.

v0.2.1

Choose a tag to compare

@dvhsh dvhsh released this 29 Sep 00:58
cc3f232

Fixed

  • styles.css sets .bb-img to display: inline with baseline alignment, as osu! shows images. Under a reset that makes every img a block (Tailwind's preflight), images written side by side, like a collab row, stacked one under another.

v0.2.0

Choose a tag to compare

@dvhsh dvhsh released this 28 Sep 23:22
0b696e9

Added

  • LIMITS.nesting (100) and the too-deep lint warning for tags nested past it.

Changed

  • An unclosed [box] or [spoilerbox] renders as a box that runs to the end of what holds it (the post, or the quote or box around it), as on osu!, instead of as text. lint reports it as an unclosed-tag warning, and the node's close is null.

Fixed

  • Deeply nested tags no longer overflow the stack. A 60,000 character post of nested [quote], [box] or [list] tags, or boxes nested inside box titles, threw RangeError from render and lint in Node and Chromium. Tags nested past LIMITS.nesting (100) now stay text, and lint reports the new too-deep warning once.
  • validateImagemap (and so serializeImagemap) refuses [/imagemap] in the image URL, a link or a title. It ended the written block early, so osu! showed the imagemap as text.
  • Parsing, rendering and linting take linear time on hostile input. 60,000 characters of [box=, [c] with a close on a later line, [url] or unterminated [a= took up to 5 seconds in Node, so one post could stall a server rendering it. Close tags, newlines and box title ends are now found once per document.
  • A bare link followed by bracketed text (https://a.b[x]) leaves the brackets out, as osu! does.

v0.1.0

Choose a tag to compare

@dvhsh dvhsh released this 28 Sep 22:15
8f0c31a

Added

  • parse and serialize: osu! BBCode to a lossless tree with source ranges and back. Unclosed, unknown and malformed tags stay text, as on osu!.
  • render: safe HTML with bb- classes, osu!'s newline eating and automatic links, and an optional media proxy.
  • lint with eleven codes and fixes where obvious, applyFix, count, LIMITS, TAGS and findTag.
  • ./styles.css: a dark stylesheet for rendered output, with a light variant (bb--light).
  • ./helpers: color, normalizeColor, gradient (with its character cost), flag, profile, box, list and escapeBBCode.
  • ./imagemap: parseImagemap, validateImagemap, serializeImagemap and formatPercent.
  • ./flags: COUNTRIES (ISO 3166-1 alpha-2), findCountry, searchCountries, flagUrl and normalizeCountryCode.
  • ./template: fillTemplate, templateFields and FIELD_KINDS.