-
-
Notifications
You must be signed in to change notification settings - Fork 62
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
effect.check() modify events when construct is for document and has resolver #86
Comments
Maybe I can help better if you share what you want to do? |
@wooorm Thank you for your reply. I've been trying to implement a micromark extension for definition list in this spec.
would makes the following HTML.
I read setext-underline.js and list.js and imitated them because their syntaxes look like one which I wanted to handle. |
If you really want to do this, I think you might be better of looking at footnote definitions for the “container” part, those colons, see: https://github.com/micromark/micromark-extension-footnote/blob/561f958a9bf33a1f3f0d2f61b370199dbff2610b/dev/lib/syntax.js#L45-L49. But, honestly, I think this is a bad designed syntax extension, that doesn’t match how markdown works otherwise. Better solutions in my opinion are either directives (Arbitrary extension mechanism in § Extending markdown): :::definition[Orange]
The fruit of an evergreen tree of the genus Citrus.
:::
:::definition[Apple]
* Pomaceous fruit of plants of the genus Malus in
the family Rosaceae.
* An American computer company.
:::
:::definition[Term 1, Term 2]
Definition a
::: Or (ab)using lists (Using and abusing markdown to add new meaning in § Extending markdown): * **Orange**
The fruit of an evergreen tree of the genus Citrus.
* **Apple**
* Pomaceous fruit of plants of the genus Malus in
the family Rosaceae.
* An American computer company.
* **Term 1**
**Term 2**
Definition a |
@wooorm Thank you, I'll take a look at
Well, the behavior about
If this behavior is not a problem, please close this issue. And thank you for your help! |
Just FYI. Thanks to your kind help, I've finally published my extension package. Regards |
Awesome, glad it worked! I looked through the readmes and here are some suggestions, If you’re interested:
👋 |
Going to close this, as this particular thing is intended. Maybe some docs somewhere might be good, and I’d appreciate a PR for that if you have a suggestion! |
I published new version including your suggestions, bug fix, some improvement.
|
Done! |
Initial checklist
Affected packages and versions
micromark
Link to runnable example
https://github.com/wataru-chocola/report-micromark-20210827
Steps to reproduce
Run my PoC.
Expected behavior
document
constructs are invoked twice inmicromark/lib/initialize/document.js
:from
checkNewContainers
statefrom
documentContinued
And I expect the first invocation
effect.check(...)
doesn't make any modifications on events.Actual behavior
effect.check()
does modify events if construct is for document and has resolver.My construct in PoC code dumps context.events at the start.
On 1st run (from
effects.check
), we see the correct events which are generated by previous tokenization.But on 2nd run (from
effects.attempt
), events are modified by resolver in the previouscheck
execution.Runtime
No response
Package manager
No response
OS
No response
Build and bundle tools
No response
The text was updated successfully, but these errors were encountered: