Skip to content

v2.2.0

@caochitam caochitam tagged this 14 Apr 15:07
Cover the remaining Zalo TextStyle palette the 2.1 release didn't use:
Red / Orange / Yellow / Green, Small (f_13), and Indent with indentSize.

### Colours via GFM admonitions

Markdown doesn't have native colour syntax, so reuse GFM admonitions — an
extension most LLMs already produce when asked for warnings/tips:

  > [!TIP]       → Green    (c_15a85f)
  > [!NOTE]      → Yellow   (c_f7b503)
  > [!IMPORTANT] → Yellow   (same as NOTE)
  > [!WARNING]   → Orange   (c_f27806)
  > [!CAUTION]   → Red      (c_db342e)
  > [!DANGER]    → Red      (alias)

The marker line (`> [!TYPE]`) is stripped; the colour is applied to every
subsequent blockquote line until a non-blockquote line ends the block. Each
coloured line still gets the `│ ` quote prefix so the visual grouping stays
even when Zalo strips styles in older clients.

### Small font
`<small>text</small>` → TextStyle.Small (f_13) inline span. HTML-like tag
avoids collision with any markdown syntax and LLMs produce it naturally for
footnote-sized content.

### Indent (nested lists)
A list item with leading whitespace gets a TextStyle.Indent span whose
`indentSize` is `Math.floor(leadingSpaces / 2)`. zca-js's handleStyles
encodes this as `ind_<N>0` (e.g. indentSize=2 → "ind_20") so Zalo client
shifts the line by the correct level. Only applies to ul/ol items; bare
indented paragraphs keep their literal whitespace.

Verified against 11 samples covering every block/inline path.
Assets 2
Loading