-
Notifications
You must be signed in to change notification settings - Fork 620
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Markdown: add hashtags functionality #3747
Conversation
Looks nice. If you are good at git, polish the pull request with git rebase -i and git push --force. e9d8451 comes first. Please, use "main,refactor: " as the prefix of the commit header. 8372df3 should comes second. So you can use functions declared in utf8_str.h in the code supporting the hashtag kind. Please, use "Markdown: " as the prefix of the commit header. Put the sentences in the description of this pull request, "Some markdown editors or plugins, such as Obsidian and VSCode markdown-hashtags, support parsing #hashtags and navigation. I have modified the markdown parser to support hashtag syntax parsing." to the commit log of the second one. It is helpful to understand the commit. a58be23 should be squashed into the first one. @masatake's TODO:
Thank you. |
Codecov ReportPatch coverage:
Additional details and impacted files@@ Coverage Diff @@
## master #3747 +/- ##
=======================================
Coverage 83.01% 83.01%
=======================================
Files 226 227 +1
Lines 55086 55126 +40
=======================================
+ Hits 45727 45764 +37
- Misses 9359 9362 +3
☔ View full report in Codecov by Sentry. |
Thanks for your tips! Now the polished PR is ready. |
70ad291
to
8cb18cb
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you add the original comment of this pull request to the commit log? It helps a person understand this pull request.
Some markdown editors or plugins, such as [Obsidian](https://help.obsidian.md/Editing+and+formatting/Tags) and [VSCode markdown-hashtags](https://github.com/vanadium23/markdown-hashtags), support parsing #hashtags and navigation. I have modified the markdown parser to support hashtag syntax parsing.
parsers/markdown.c
Outdated
.enabled = false, | ||
.name = "hashtag", | ||
.description = "#hashtag", | ||
}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(review comment Group 1)
parsers/markdown.c
Outdated
}; | ||
|
||
typedef enum { | ||
F_MARKER, | ||
F_HASHTAG, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(review comment Group 1)
The first commit and the third commit are ready to merge. Thank you. |
It's OK |
It's OK, and it is better to cherry-pick the first and third commits. I plan to open a new PR (or continue in this one) for the qualified hashtag feature. |
I force-pushed again. Now the first commit is duplicated with #3749 and the third commit implements the features for |
Close universal-ctags#3748. A test input is derrived from Yinzuo Jiang (@jiangyinzuo)'s commit in universal-ctags#3747. Signed-off-by: Masatake YAMATO <yamato@redhat.com>
Close universal-ctags#3748. A test input is derrived from Yinzuo Jiang (@jiangyinzuo)'s commit in universal-ctags#3747. Signed-off-by: Masatake YAMATO <yamato@redhat.com>
Could you rebase this pull request on the latest master branch? |
…_raw_strlen function in main/utf8_str.c
Done. Could you please review the second commit again? |
parsers/markdown.c
Outdated
@@ -57,6 +60,8 @@ static kindDefinition MarkdownKinds[] = { | |||
{ true, 'T', "l4subsection", "level 4 sections" }, | |||
{ true, 'u', "l5subsection", "level 5 sections" }, | |||
{ true, 'n', "footnote", "footnotes" }, | |||
{ true, 'h', "hashtag", "hashtags"}, | |||
{ true, 'H', "subtag", "subtags in hashtags"}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you think we should have both hashtag and subtag?
Having only hashtag is not enough?
We are going the wrong way. Could you push the original version to that the sub-hashtag was not introduced yet? |
BTW, I found you are using your So you can track the change on the master branch of the upstream and develop new features simultaneously. |
Some markdown editors or plugins, such as [Obsidian](https://help.obsidian.md/Editing+and+formatting/Tags) and [VSCode markdown-hashtags](https://github.com/vanadium23/markdown-hashtags), support parsing #hashtags and navigation. I have modified the markdown parser to support hashtag syntax parsing.
Thank you! |
I have some advises about tagging See php.c:
You can do the same as the PHP parser does:
With this change, ctags generate full-qualified tags like
When making a tag for |
Some markdown editors or plugins, such as Obsidian and VSCode markdown-hashtags, support parsing #hashtags and navigation. I have modified the markdown parser to support hashtag syntax parsing.