-
Notifications
You must be signed in to change notification settings - Fork 129
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
Render attribute tags with double quotes instead of single quotes as default #94
Comments
Thanks for the issue, @leifriksheim. HTML allows both single and double quotes so I would open an issue with showdown (though given its longevity I would expect an issue to already exist). In the meantime, I will consider adding a new option. Right now I see 4 strategies:
I am not seeing a straight forward solution to the encoding bit. I would like to make us more resilient in the case that both single and double quotes are used in the attribute value if it does not complicate things too much. If it turns out to be hard, it may be worth making a In the mean-meantime feel free to copy/paste the stringify function into a util and bend it to your will. |
Thank you for a quick answer! I'll copy/paste for now. Love the package btw, exactly what I was looking for! |
After giving this some thought I think the best approach is to make a new package like The reason a brand new package is preferable:
@leifriksheim If you want to take over that endeavor I'm all for it. We can talk about potential APIs to expose and what not for the new package if you want. If that's too much work, someone else may pick it up or I'll keep it in the back of my mind for a future release as a potential enhancement. |
I'm writing a custom plugin for a markdown parser. I'm using Himalaya to make an AST, append some tags and return the text again to the parser. The problem is that the parser (showdownjs) won't render the html correctly because it want's to receive
<div class="my-class">
but the stringify function returns<div class='my-class'>
It could be intentional, but I think it would make sense to render attribute tags with double quotes instead of single quotes as default. Or maybe make it available in options at least?
himalaya/src/stringify.js
Line 10 in f0b8700
The text was updated successfully, but these errors were encountered: