dart-lang / markdown

A Dart markdown library
https://pub.dev/packages/markdown
BSD 3-Clause "New" or "Revised" License
443 stars 202 forks source link

Provide offset/lengths for nodes #369

Open DanTup opened 3 years ago

DanTup commented 3 years ago

There are some places in the analysis server that could benefit from parsing Markdown. For example https://github.com/Dart-Code/Dart-Code/issues/3330 relates to code blocks no longer being highlighted in VS Code when Semantic Tokens are enabled (Semantic Tokens replace the old regex-based colouring, but the server doesn't produce highlights regions for the code blocks nested inside markdown).

Parsing the comments using this library produces code elements for the things I'd like to highlight, but it appears the offset/length are not provided on the nodes so it's not possible to produce a highlight region for that code.

If this seems like a reasonable extension, I'm happy to have a go at implementing it if someone is happy to provide pointers and/or reviews. Thanks!

srawlins commented 3 years ago

This is in the works. I hope to land it this quarter (in the next 6 weeks). It involves a huge refactoring of how markdown is parsed; currently there is no Markdown source parse tree; only an output HTML AST.

DanTup commented 3 years ago

Neat! I did wonder if the current AST might cause issues for non-HTML uses, so this sounds ideal. Thanks!

frmatthew commented 3 years ago

Any update on this issue? Thanks.

srawlins commented 3 years ago

My teammate and I with whom I planned to work on this had a lot of non-overlapping vacation this summer, so I didn't get to land anything in June as I hoped. My new target is end of September. 🤞

DanTup commented 2 years ago

@srawlins out of interest, is this still on your radar?

srawlins commented 2 years ago

Oof, it is, but it keeps getting bumped by other slightly higher priority projects. :/ I should not announce a new target date.

DanTup commented 2 years ago

lol, I know the feeling. It's not urgent to me, it's just useful to know if it may be on the way in the near-term or not :-) Thanks!

Number-3434 commented 8 months ago

2024 - Any updates yet?

Concerning Issue #3648 - Comment References

I would really appreciate this, since this is the reason that documentation comment references cannot be parsed.

Since this is a pretty big bug, I think this issue deserves more attention.

For me, it is one of the only problems with the otherwise nearly-perfect Dart extension for VSCode.

[!NOTE] This works in JavaScript, maybe something could be copied over from that?

srawlins commented 8 months ago

2024 - No updates.

I would appreciate it as well. Sorry, it has not made it to the top of our priorities.