jgm / djot

A light markup language
https://djot.net
MIT License
1.66k stars 43 forks source link

Provide line/column positions instead of (or in addition to) byte offset #89

Closed jgm closed 1 year ago

jgm commented 1 year ago

This would be more useful for many purposes. We just need to construct a table that maps byte offsets to line, column pairs. We can do that by iterating over the characters using the lua utf8 functions.