-
Notifications
You must be signed in to change notification settings - Fork 9
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
👌 IMPROVE: Add parsed_directive
and parsed_role
parent tokens
#34
Conversation
Thanks for submitting your first pull request! You are awesome! 🤗 |
token.content.trim() ? token.content.split(/\r?\n/) : [], | ||
directive | ||
) | ||
const directiveOpen = new state.Token("parsed_directive_open", "", 1) |
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.
This looks good!
// Ensure `meta` exists and add the directive options to parsed child | ||
newTokens[1].meta = { | ||
directive: true, | ||
...data.options, | ||
...newTokens[0].meta | ||
...newTokens[1].meta | ||
} |
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.
As just discussed, I don't think we need this any more, since you can retrieve this info from the (directive) parent node.
Cheers guys, so yep as we have just discussed, this change ties into: #31 (comment): In order to not lose the information, of what nodes were generated from directives/roles, we now include a parent node, e.g. <admonition class="note" directive="true">
... will now be output as: <parsed_directive name="note">
<admonition class="note">
... |
parsed_directive
and parsed_role
parent tokens
Adds:
parsed_directive
andparsed_role
tokens to wrap parsed contentlegend
tokens for paragraphs aftercaption
in figureOther context here:
#31 (comment)