flexmark-java
flexmark-java copied to clipboard
Clarification about BasedSequence#endOffset
Hello, I'm trying to understand why does BasedSequence#endOffset is always 1 more than its index value. For example, this code prints 4 instead of the 3 I expected by assuming that offsets are 0-based.
val parser = Parser.builder().build()
val node = parser.parse("*hi*")
println(node.endOffset)
What might I be missing?
Apparently this is inline with how styling works on most platforms where the end offset is assumed as "exclusive". Can I convince you to either rename endOffset to endOffsetExclusive or at least mention this in its doc?