-
Notifications
You must be signed in to change notification settings - Fork 5
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
Provide access to 'smartypantsu' somehow #168
Comments
I think a better option would be to add config option to smartypants to output html entities or utf8. That way config is all in one place |
True, but having the option is stil better than not having it and at least marked-smartypants can have all its config in one place + such a small effort. For the users and depending packages of the most popular markdown js package that didn't have the time to upgrade 6 major versions in half a year and who relied on the smartypants option pre-5.x that was substituted for a similarly-named package with a silent but very impactful breaking change (multiplying output size and considerably degrading render perf cf #33). If anything the single method used should be |
Users still have the option to do it the same way you did in postprocess. I would argue having a simple options for everything is not always better than not having it
Just that it is the only npm package that matches the full smartypants spec. If you find (or create) a different package I have no problems with switching to that. Honestly I think it would be easier and use less bites to not use smartypants https://github.com/othree/smartypants.js#why-you-might-not-want-to-use-smart-quotes-in-your-weblog |
Totally agree and don't even use it personally. I'm coming at this from a point of view of minimizing breaking changes and user turnover as a major package maintainer. I commend the move to extensions but conclude that I am forced to include |
If you don't want breaking changes than marked-smartypants-lite is the right way to go. That extension models the way marked did smartypants pre v5. It does a not follow the spec at all which is why we have two packages. Users can choose spec compliant or light weight. |
In the marked implementation here: https://github.com/alphagov/govuk-design-system/blob/main/lib/marked/extension.js#L16-L25,
it became clear to me that users opting out of HTML entity encoding are forced to
npm install smartypants
separately to have backwards-compatible processing with pre-marked 5.0.0 smartypants option (and as in marked-smartypants-lite).Perhaps add an option next to
config
:htmlEntities
(default=true) - "HTML-encode special characters", orutf8
(default=false) "Do not HTML-encode special characters"?Willing to contribute a PR when the direction is clear
The text was updated successfully, but these errors were encountered: