-
-
Notifications
You must be signed in to change notification settings - Fork 138
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 engine specific delimiters #75
base: master
Are you sure you want to change the base?
Conversation
This is a great start! Nice work.
I'm thinking we should allow users to decide how they want to specify the engine to use:
The main goals are performance and reliability, as long as it satisfies those two things I'm open to whatever approach you want to take. Although I'd probably favor options versus additional methods. |
Previously, if you specified the language after the fence in the front matter, it would override the language passed into the options. With this change, any recognized custom delimiter will also override the passed in language. After thinking about it seems okay, it is the document which gets to specify the language, and the options are just providing the fallback language. So on that front, all is fine. The issue with As for performance, the cases where there is front matter with a default delimiter should be unchanged. The only situation which would be affected is if you have a string or file without any front matter, and you have many engines defined. I've pushed a small tweak to ensure you don't register a custom engine delimiter the same as the default one. |
I didn't regenerate the README file, but I did update the underlying verb file. I wasn't sure if you normally do that. The output differed in a couple of ways, so I didn't want to presume. |
@jonschlinkert Just checking in to see if you've had a chance to look at this further. I think it is mergeable, just let me know if you want me to regenerate the README or any other housekeeping. |
Just revisiting this as I’ve come across another place where I’d like the per-engine delimiters. |
This PR does make some changes to the nature of
matter.language()
, which probably isn't desired. I can remove that and make another method for this if necessary, but I thought I'd get a working version out there for review.Files parsed with custom delimiters should round-trip via stringify correctly.