goldmark
goldmark copied to clipboard
Fix panic in table parser
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