Code in func (b *tableParagraphTransformer) parseRow used the segment's Value to calculate some offsets as if Value always corresponds 1 to 1 to the source. Segments with padding cause incorrect behavior generally, and an out-of-bounds source access in pathological cases.
I switched the code to use padding-aware segment.TrimLeftSpace and segment.TrimRightSpace instead of raw util.TrimLeftSpaceLength and util.TrimRightSpaceLength
Code in
func (b *tableParagraphTransformer) parseRow
used the segment'sValue
to calculate some offsets as ifValue
always corresponds 1 to 1 to the source. Segments with padding cause incorrect behavior generally, and an out-of-boundssource
access in pathological cases.I switched the code to use padding-aware
segment.TrimLeftSpace
andsegment.TrimRightSpace
instead of rawutil.TrimLeftSpaceLength
andutil.TrimRightSpaceLength