Skip to content

v0.14.1 — surface image src URLs in JSON

Choose a tag to compare

@sunholo-voight-kampff sunholo-voight-kampff released this 14 May 05:15
· 557 commits to main since this release

Image, audio, and video src URLs now in JSON output

HTML, Markdown, ODT, and EPUB parsers capture image URLs into the block's data field, but output_formatter.ail only serialized the URL's character count (dataLength). The actual URL was thrown away. Inspecting parsed output of www.sunholo.com showed image alt text + mime + a numeric length, but zero way to recover "where did this image come from?" without re-parsing the source.

New JSON shape

{
  "type": "image",
  "description": "AILANG Logo",
  "mime": "image/unknown",
  "dataLength": 15,
  "src": "ailang-logo.svg"
}

The src field is length-gated to 2048 characters: short URLs/paths from HTML, Markdown, ODT, and EPUB surface in the output, while DOCX/PPTX inline base64 binary payloads (often megabytes) stay represented by dataLength alone. Emitting MBs of base64 as src would bloat JSON by orders of magnitude.

Same shape applies to AudioBlock and VideoBlock for symmetry.

Compatibility

Purely additive. Existing consumers reading description/mime/dataLength continue to work; new consumers can opt into src. Eleven affected goldens refreshed; all eval at 100% against the new shape.

Known limitations not addressed in this patch

These are real losses on production HTML — flagged for a future release:

  • Images nested inside <a> tags are still dropped. The anchor branch falls through to text-only mode. On www.sunholo.com this loses 8 of 12 images (they live in <a class=\"card\"><img></a> patterns).
  • <a href> URLs themselves are not captured. 62 anchor hrefs on sunholo.com → 0 in JSON. A future LinkBlock type or extended TextBlock with optional href would close this.
  • <img> attributes beyond src and alt (width, height, srcset, loading, title) and <picture>/<source> elements are not captured. Schema change, deferred.

Changelog

Full v0.14.1 entry


Package registry: sunholo/ailang_parse@0.14.1 published.

SDKs: unchanged.