-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Converting Straight-Quotes Discourages Future Processing #287
Comments
@fredleblanc You could try writing a simple extension which would not do that for you. |
@hkdobrev Absolutely! Please don't get me wrong, I'm not saying I don't want to do the work, I was more just hoping for advice about the rest of the internals. From early testing nothing seems to break, but I didn't know if there was a known "oh, that has to be done or else this won't work" thing I wasn't seeing. |
@fredleblanc I don't think there would be a problem. If you make something good and generic you could add it to the wiki to help others! https://github.com/erusev/parsedown/wiki/Writing-Extensions |
I ran into this recently while making a Parsedown wrapper for WordPress. WP already does HTML special chars and curly quotes on its own, so Parsedown converting " to " messed this up. This is how I disabled this functionality, for anyone interested: class Parsedown_WP_Parser extends ParsedownExtra
{
protected function inlineSpecialCharacter( $excerpt )
{
// Do nothing. WordPress handles HTML special characters
// and curly quotes by default.
}
} This is easy to fix on your own, but I wonder if converting " is even a part of what a Markdown processor should do. Thoughts? |
I ended up doing something similar on my end. Although I share the opinion that I wouldn't have a markdown processor handle this by default, I also understand that this decision certainly lives in the opinion district of opinionated software, and I respect that. (I tend to think that opinionated software is the best software.) And as you've pasted, my code being similar, it's easy enough to "undo" if you don't want it.
|
This should no longer occur in the next release, more info in #573 and the related PR. |
The
inlineSpecialCharacter
method is replacing"
characters with"
characters, but this is limits how the output is processed through other text modifiers. Mainly, in my case, running the text through SmartyPants. Because straight double-quotes are entities, SmartyPants won't process them into "smart" curly quotes.I know that converting
"
into"
isn't really a bug, it's more a feature that's getting in my way for later. I guess my question is — how necessary is this conversion to an entity for the rest of the code? Is other code relying on straight-double-quotes already being escaped?The text was updated successfully, but these errors were encountered: