GithubHelp home page GithubHelp logo

When inside $...$, $$...$$, $$$...$$$, should not only inject latex, but also wrap with an inline_formula or displayed_equation node. about tree-sitter-markdown HOT 4 CLOSED

haoming-li-ling avatar haoming-li-ling commented on June 17, 2024
When inside $...$, $$...$$, $$$...$$$, should not only inject latex, but also wrap with an inline_formula or displayed_equation node.

from tree-sitter-markdown.

Comments (4)

wzf03 avatar wzf03 commented on June 17, 2024 1

After the nvim-treesitter/nvim-treesitter#5857 has been merged, these node can be parsed normally, which solve this issue.

from tree-sitter-markdown.

MDeiml avatar MDeiml commented on June 17, 2024

It is not possible to tell the injected grammar (in this case the latex grammar) what node the root node should be. The workaround used instead is that we also include the dollars in the injected range. This way the latex grammar will automatically parse everything as it should be.

For me this also seems to be working fine. Which editor are you using? Maybe the injection queries are implemented differently?

from tree-sitter-markdown.

wzf03 avatar wzf03 commented on June 17, 2024

Yes, the highlighting works actually fine. But the problem is that some snippets plugins for latex math depend on these nodes. So it would be really useful to name these nodes with inline_formale and displayef_equation.

from tree-sitter-markdown.

wzf03 avatar wzf03 commented on June 17, 2024

Actually this is a bug of nvim-treesitter, and it should be solved in nvim-treesitter.
nvim-treesitter/nvim-treesitter#5857

from tree-sitter-markdown.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.