-
Notifications
You must be signed in to change notification settings - Fork 53
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 remark-abbr to tests and re-record snapshots #515
Add remark-abbr to tests and re-record snapshots #515
Conversation
I'm way too surprised that the tests work (apart from these backslashes, I'll check). It seems that actually the plugin might work out of the box on new remark versions: it relies only on |
Hum I see unrelated linting problems, I fixed on |
The only difference in the snapshots seems to be the presence of `\\` backslashes before quote characters. I'm a little confused by the output, not being all that familiar with jest, but I suspect this is some minor difference in the way that rehype-stringify works and that we don't need to worry about it?
996a51a
to
9e23f7d
Compare
Haha 🤣 I didn't try the version on the I didn't even bother to read the code properly, I just jumped straight in to building my own plugin from scratch. So it's a suprise to me that it works too! (but only a suprise because I made bad assumptions). As you say, if the plugin does everything at the AST level, it shouldn't be bothered by the change in parser. So hopefully a minimal bit of tidy up and we're all good. My odyssea of dodgy assumptions so far:
I'll port some of my test suite over, and we can see if there's any reason to bother with micromark, or if this covers all the edge cases well enough already. |
To be clear: I am not at all advocating for our plugin, I think the way it currently works by basically using Regexes on the AST is quite weird. So if your extension has a more "micromark-compatible" way of doing things, I think it would be nice to implement anyway. Also, the version published on NPM should be quite (if not exactly) similar to what we have in the I read your code quite rapidly, so I might have misunderstood things, I will read properly on MR, but from what I understand:
Is this right? If not, can you correct me? [EDIT: seems to correspond to what you described above] Regarding this MR, it looks ready to merge. I will once the current state of |
Yeah, that's exactly correct. Micromark parses the abbreviation definitions, and then a transformer splits text nodes into |
So… I tested, and in fact we do that today: using an (old-style) Merging this PR now, and will get the repo fully ready for your changes. |
And since I forgot to answer about the backslash changes: I do not think we care much for now, if it becomes reversed after your change you might change it again, I do not think I encountered it before when migrating plugins so I am not sure if expected or not. |
Ok so now tests do not run: they were actually still run with the old version of remark. You can start integration whenever you want, everything is ready on my side. I also disabled or fixed other failing tests so your objective is to get back to CI green check. |
The only difference in the snapshots seems to be the presence of
\\
backslashes before quote characters.I'm a little confused by the output, not being all that familiar with jest, but I suspect this is some minor difference in the way that rehype-stringify works and that we don't need to worry about it?
This is just laying a small bit of groundwork, before I attempt to get remark-abbr working with the new version of remark
See also #514