codecs

libraries/kinogaki-codecs · 0 open · 10 done

Complete and tested (part of kinogaki-core). Nested markdown lists verified + pinned, the lenient decoders fail closed on malformed input, JSON surrogate pairs combine, segment/xml helpers are shared, and the README lists all six shipped codecs. 229 cases / 1209 checks green.

codecs_1markdown nested lists are claimed but silently unsupportedDone HIGH
bug · completeness

Resolved 2026-06-20. Verified nested markdown lists parse and round-trip as a fixed point; pinned with a test. The header 'incl. nesting' claim is honest.

codecs_2document/vector decoders ignore ParseError and never failDone MED
bug · completeness

Resolved 2026-06-20. The markdown/html/svg decoders now fail closed on the gross structural failure each can detect (unterminated fence/island/root) and report a ParseError; the total-vs-fallible contract is documented in each header.

codecs_3README documents only `json`; the other five codecs are presented as future workDone MED
task · organization

Resolved 2026-06-20. README now lists all six shipped codecs (json/markdown/html/svg/text/blob) + the bundle convention, pointing at CANONICAL.md.

codecs_4no malformed-input tests for markdown/html/svg; lossy round-trips asserted but not pinnedDone MED
task · tests

Resolved 2026-06-20. Added malformed-input tests per codec, the html->md degradation table, and HTML entity/UTF-8 edge cases.

codecs_5`safeSegment` duplicated across two codecsDone LOW
task · separation

Resolved 2026-06-20. Factored the representable-segment charset into codecs/internal/Segment.h, shared by JsonCodec and Bundle.

codecs_6entity/escape helpers duplicated between HtmlCodec and SvgCodecDone LOW
task · separation

Resolved 2026-06-20. Factored appendUtf8/decodeEntities/escapeText/escapeAttr into codecs/internal/XmlText.h, shared by HtmlCodec and SvgCodec.

codecs_7JSON `\u` surrogate pairs not combined (documented, untested)Done LOW
bug · completeness

Resolved 2026-06-20. JSON uXXXX high+low surrogate pairs now combine into astral code points (4-byte UTF-8); lone surrogates handled. Covered by a test.

codecs_8function names are cleanDone LOW
task · naming

Where: src/ (all files)

Problem: None material. Free functions read as verbs (escapeTo, numberTo, dumpTo, parseInline, parseBlocks, renderBlocks, buildChildren, writeElement, materializeFile, addFile, addFolder, graft). A few helpers are predicate-/noun-shaped (attr, lower, root, standalone, safeSegment, docCodec, svgCodec, entries, fileName, leavesOf, childrenOf), but these are accessors/queries/factories where the noun form reads naturally and matches the surrounding codebase style; bool predicates are appropriately is*/blank/contains. Not worth churning.

Fix: None required.

codecs_9cleanDone LOW
task · filesize

Where: src/

Problem: Largest source file is src/HtmlCodec.cpp at 413 lines; next is src/MarkdownCodec.cpp at 348. Nothing exceeds 800, let alone 1000.

Fix: None required.

codecs_10no committed build artifacts; layout is cleanDone LOW
task · organization

Where: repo root

Problem: None. build/ and .DS_Store are git-ignored (.gitignore), no .o/.a/_site is tracked, headers mirror sources, tests mirror codecs, both build.sh (clang loop) and CMake are present and consistent. The only orphan-adjacent note is the stale README (covered above).

Fix: None required.