-
Notifications
You must be signed in to change notification settings - Fork 46
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
Add term syntax DOCSTOOLS-1268 #172
Conversation
69c1328
to
7b0e32a
Compare
@@ -0,0 +1,110 @@ | |||
import StateCore from 'markdown-it/lib/rules_core/state_core'; |
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.
I didn't find any errors or warnings. Example, if user use term which not declared. Could you add it and another cases?
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.
Found duplicate, but use undeclared def looks more important
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.
Added two more lint warning rules:
- Term used without definition
- Term inside definition not allowed
src/transform/title.ts
Outdated
// cut out "heading_open", "inline" and "heading_close" tokens | ||
contentTokens = tokens.slice(3); | ||
contentTokens = [...tokens.slice(0, start), ...tokens.slice(start + 3)]; |
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.
Who do you need this change?
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.
In term plugin I push the __yfm_lint
token to define warnings. If the __yfm_lint
token became the first token on the page, then function extractTitle
does not work properly, because it expects the first token to be heading_open
. So I skip all first lint tokens.
As the alternative, I thought that I can pass runningInLint
variable in pluginOptions
and based on that add or not __yfm_lint
token. But this will lead to inconsistency tokens when run on lint and not.
cd848a2
to
79c5332
Compare
Add term syntax: