Comments (4)
This has been discussed earlier, specifically see this issue and comment: #81 (comment)
You don't need to look at parsers for TS or MDX I think, since the javascript in these files would best be parsed using language injection. Basically you don't need to worry about parsing javascript, you just need to able to properly mark places where there is javascript, i.e. export statements, curly braces.
You're right that MDX would probably best be implemented as a superset / fork of this parser rather than from ground up, since most of the syntax is markdown anyways.
The main difficulty in implementing this is then understanding the markdown parser with markdown being a very messy language. It's probably helpful to read through the entirety of this page first if you haven't done so yet.
from tree-sitter-markdown.
You don't need to look at parsers for TS or MDX I think, since the javascript in these files would best be parsed using language injection. Basically you don't need to worry about parsing javascript, you just need to able to properly mark places where there is javascript, i.e. export statements, curly braces.
Ok great, that's what I thought. I see someone attempted to do it themselves but obviously didn't complete the task.
In that thread, another individual said they'd prefer MDX as a separate parser -- and I happen to agree. MDX seems to be a completely different language and I don't think it should be implemented on top of ts-markdown (unless it becomes stable in a long time). Once I start this in a few months I think forking will be the best option, although I'm not sure how keeping it updated will work.
Also, thanks for your patience constantly dealing with people who don't know a lot when you seem to be an expert on the matter. Hopefully I can contribute something meaningful in a month or two (or three).
from tree-sitter-markdown.
Haha, I'm not an expert by far, but I appreciate the comment. Feel free to ask me any questions that come up.
from tree-sitter-markdown.
Although code highlighting within backtick blocks does indeed work when tagged as JS, its just not enough. There is very little support for good syntax higlighting within an MDX file, a lot of things like top level imports just don't get highlighted currently.
from tree-sitter-markdown.
Related Issues (20)
- How to install, verify extension in neovim ? HOT 5
- How do I tell if I'm using experimental or basic highlighting in neovim HOT 3
- Inline bold and italics not working in nvim HOT 10
- Document requirement for static linking with Wasm HOT 1
- Nested list item with 4 indents is concealed unexpectedly HOT 5
- Extend front matter support
- Disable underline for none-latin CJK letters. HOT 2
- markdown highlight error HOT 14
- Transfer parser to tree-sitter-grammars org? HOT 4
- Code block not recognized as one if there is trailing space on the closing fence HOT 5
- markdown-inline grammar fails tests HOT 1
- feature: pandoc raw_tex and raw_attribute support HOT 4
- feature: Add a performance comparison to the README HOT 1
- bug: Latex injections appear multiple times in AST HOT 1
- bug: Escaped `\$` counts as end of latex block
- bug: go binding cannot be imported HOT 1
- bug: README: inline latex is not listed in Extensions HOT 1
- bug: text ending with numbers in underscore block is not italic
- bug: Final fence not properly parsed in code blocks HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from tree-sitter-markdown.