Repository navigation
0.9.0
What's Changed
Security hardening
This release hardens the rendering pipeline against untrusted input:
- XSS: untrusted text is now escaped in every legacy painter, so SVG/HTML output is safe even when the human-readable label contains markup characters.
- Text cap: text longer than 4000 characters (globally settable/resettable via
setMaxTextLength/resetMaxTextLength) now throws the library's checked exceptions instead of producing unbounded output — in both Java and Node. - RenderSpec bounds:
barWidth(≤ 100),barHeight(≤ 10 000) andmoduleSize(≤ 100) are validated in Java and Node, with integer checks on the Node side. - Code 128 is encoded with a fixed charset (ISO-8859-1) in both implementations, removing platform-dependent default-charset behaviour.
- CI: all GitHub Actions are pinned by commit SHA and npm is pinned to 11.5.1 in the workflows.
- Registry:
register()no longer allows shadowing a registered format id, and id normalisation uses an explicit locale (Locale.ROOT) in Java. - module-info exports are narrowed to the public API surface.
Rendering fixes
- EAN/UPC labels are padded defensively before fixed-offset
substringcalls, so short labels can no longer crash withStringIndexOutOfBoundsException. - The human-readable text area now honours the
RenderSpecbackground via a new spec-awarepaintTextSvg/paintTextWithSpec(previously hardcoded#fff, which broke the visual on dark backgrounds) — in both pipelines. - SVG output emits
preserveAspectRatio="xMidYMid meet"and normalises#fffto#ffffff(goldens regenerated accordingly).
Improved
- The user
RenderSpecis now fully propagated through the Node linear format: colours from the user spec reach the bar renderers and the text renderers, matching the Java behaviour end-to-end. - The Node
package-lock.jsonis back in sync withpackage.json.
Tests
SecurityHardeningTest(12 tests) covers the spec bounds, the text cap, the registry rule, label padding and legacy XSS escaping.- A new Node test verifies spec colours in the raster pixels and SVG fills — 729 Java tests + the performance integration test, 98 Node tests, all green.
Full Changelog: pr-0.8.0...pr-0.9.0