-
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
" turns into " #2
Comments
Hi vargaradu, thanks for pointing this out. I will look into it and get back to you. |
Okay so I looked into it. One of this library's dependencies, hickory, automatically escapes html entities, even in cases where it is not necessary or unwanted in hiccup. It's an open issue to allow clients to configure this: clj-commons/hickory#25 I will see what I can do in the time being. There were a few possible workarounds mentioned in the thread, so I will play around with these. |
Yes, suspected was a dependency who was generating the escaped html. If I have time, I'll check some of those workarounds as well. Thanks for looking into this! |
No problem. If you come up with something and are so inclined to get your hands dirty, feel free to make a pull request :) |
OK I've found a workaround (app-side with Reagent). Quite hacky, but it does the job:
|
So, I am also facing the same issue :) |
I had to put this off for awhile but I have a solution coming soon (probably in the next few days). |
@vargaradu Okay sorry for the delay but it's fixed! Please try out version 5.0.1. If for whatever reason anybody needs to keep the html encoding, pass {:encode? true} to the md->hiccup function:
|
@mpcarolin PS: |
HI @mpcarolin, the update works well, but there a few characters which is still escaped in my documents: Sorry I didn't mention the other characters before. |
@vargaradu Thanks for the info. I will patch this tomorrow with every escapable character this time. |
Hey @vargaradu, can you perhaps give me some more information about what you are passing the function and what is returned? The two characters you mentioned map to the apostrophe ' symbol and the – (en dash) symbol, respectively. However I have tried these and several other HTML entities and md->hiccup works as expected: In my fix for 5.0.1, I only explicitly handle the characters >, <, ", and & because those are the only characters that the Hickory library escapes, using this function here. I am definitely willing to account for other HTML entities, but I want to zero-in on the issue first. |
Actually I reproduced it, but only in Clojurescript. I'll see what I can do. |
Yes, it is happening in Clojurescript. I think what you are looking for is here |
Good catch. The version I'm working on now uses some standard decoding utilities (goog.string/unescapeEntities for CLJS, and Apache StringEscapeUtils for CLJ). I think this might make things a little slower but at least it will cover everything. |
Version 0.6.0 just released, now using those standard libraries for decoding each string. This should also get rid of that annoying warning message you mentioned, @amarjeet000 . |
Working smooth now, thanks much |
The quote sympbol in the markdown text gets converted into
"
.Is there any way to get around this?
The text was updated successfully, but these errors were encountered: