Closed zhongl closed 2 months ago
```scala mdoc extension (x: Int) def ===(y: Int) = x == y
1 === ""
1 === 1
### Command line
coursier launch org.scalameta:mdoc_3:2.5.3
### Output
extension (x: Int) def ===(y: Int) = x == y
1 === "" // error: // Found: ("" : String) // Required: Int // 1 === 1 // ^
Source code position above
// 1 === 1 // ^
suppose to be
// 1 === "" // ^^
https://github.com/scalameta/mdoc/blob/06c90343cb66265e818da7fcb3ccd9ff46b9849d/mdoc/src/main/scala/mdoc/internal/markdown/Renderer.scala#L151-L155
I think TokenEditDistance from doc.sections cause confusing source code position.
TokenEditDistance
doc.sections
I'd like to submit a PR to fix it, if it make sense.
Go ahead! I haven't had the chance to look at the issue yet.
Input
coursier launch org.scalameta:mdoc_3:2.5.3
// 1 === 1 // ^
// 1 === "" // ^^