Closed boltlessengineer closed 1 year ago
Hey, thank you, this looks great. Not sure if it breaks in some edge cases, e.g. nested links, but that is not too important.
I would make it a "non-default" extension for the moment if that is ok with you? That would mean removing the EXTENSION_DEFAULT
part in the line you added in common/grammar.js
.
It also looks like you broke 2 test cases, see https://github.com/MDeiml/tree-sitter-markdown/actions/runs/4902920851/jobs/8755052765?pr=97. Could you have a look at that?
Hey, thank you, this looks great. Not sure if it breaks in some edge cases, e.g. nested links, but that is not too important.
Because Wiki-link parsing is an extension, prioritizing the wiki-link syntax in nested-link should solve the problem. Example 556 in corpus/spec.txt
is showing some nested case.
I would make it a "non-default" extension for the moment if that is ok with you? That would mean removing the
EXTENSION_DEFAULT
part in the line you added incommon/grammar.js
.
I actually tried to make this non-default extension, but I couldn't figured out how to build & test as non-default extension. I learned tree-sitter syntax first time while making this PR. Can you give me an example of building & testing non-default extensions? That will be helpful.
It also looks like you broke 2 test cases, see https://github.com/MDeiml/tree-sitter-markdown/actions/runs/4902920851/jobs/8755052765?pr=97. Could you have a look at that?
Those two test cases should be broken when wiki-link option is on. That is intended behavior because Wiki-link is not in CommonMark/GFM spec. Should I remove those test cases?
Sorry for the late answer.
Can you give me an example of building & testing non-default extensions?
You have to set the environment variable corresponding to the extension you want to enable, e.g. EXTENSION_WIKI_LINK=1
. How you do this depends on your operating system. On Linux and Mac you should be able to just write EXTENSION_WIKI_LINK=1 npm build
, just be sure to run npm clean
before that.
Should I remove those test cases?
Hm not to sure how to deal with this, I guess you can remove them for now and I'll think of something later.
@MDeiml I fixed points you said. Can you check this?
Thanks a lot, this is great! Build tests were just failing, because my CI used an older version of tree-sitter, but I just updated that to the newer version you were using.
Thanks for your work, I think a lot of people will be happy about this feature. Also sorry I took long with responding.
Added basic wiki-link parsing based on Obsidian's wikilink.