Skip to content

v1.0.5

Choose a tag to compare

@hkjang hkjang released this 02 Sep 12:55
· 30 commits to main since this release
da4b8ce

Keep masked values rune-aligned with the original text so redaction boxes cover the right region. MaskValue previously masked the trimmed value and maskAddress collapsed whitespace with strings.Fields, so the masked string could differ from the original in rune count and layout, making ComputeMaskedRuneSpans return the wrong span and paint the wrong area of the document — for example " 800901-1234567" produced span [7,14) and left the final digit visible, and double-spaced addresses covered part of the road name instead of the building number. Masking now applies to the trimmed value with surrounding whitespace restored, addresses are reassembled using the original separators via token start offsets, and ComputeMaskedRuneSpans returns nil on any rune-length mismatch so callers fall back to covering the whole field. Adds a 15-case table test asserting every rule preserves rune count and whitespace positions, plus 4 regression cases.