fsprojects / FSharp.Formatting

F# tools for generating documentation (Markdown processor and F# code formatter)
https://fsprojects.github.io/FSharp.Formatting/
Other
464 stars 155 forks source link

Optional range information for Markdown elements #742

Open artempyanykh opened 2 years ago

artempyanykh commented 2 years ago

I'm looking into using the Markdown parser for a project, but noticed that the range information is optional for markdown elements. Glancing through the code I can see only 1 place where the range can become None but this looks accidental. Am I missing something? Or the range indeed should be present for all elements in the real world scenarios.

dsyme commented 2 years ago

@artempyanykh Yes, makes sense - please do submit a PR to make the ranges non-optional

artempyanykh commented 2 years ago

@dsyme thanks! I looked into it and it seems that something's off with some span ranges (potentially around links). It seems that markdown ranges need a bit more love than I can give ATM, but anyhow I filed a separate issue specifically around correctness of ranges in case things change #744.