Closed hawx closed 13 years ago
Awesome, I knew there was a better way of doing the entities. Thanks!
After having a more in-depth look, your changes to the way entities are processed reintroduces an issue where submitting "&" spits out "&". Line 15 in entitifier.rb previously just replaced "&" with "&" but that no longer seems to work, any ideas on a (better) workaround for this?
I really appreciate your contribution, thanks again.
I don't really understand what you mean. When I put in "&" it should turn into "&" or what?
If a user were to have already converted an ampersand i.e it literally says "& amp;" then it will still convert the ampersand as if it were normal text so the result is "& amp;amp;".
I'm not seeing this bug, for me it works the same as before.
That was meant to be "& amp;" and "& amp;amp;" but obviously without the spaces.
I understand what you mean now but I still don't get the problem, try adding these two lines at the bottom of entitifier.rb
p textReplace("&")
p textReplace("&")
and when you run it you should see it print
&
&
which is the behaviour you're looking for, and this works in the version before my changes.
Strange, adding the textReplace gave me:
"&"
"&"
Are you sure you've pulled and merged my changes fully?
I have moved the entities out into hashes so there is a little less repetition. Also I have got <?php … ?> and <% … %> tags to be ignored, but only in text mode. I tried in html mode but it will probably take a completely different approach because it would just crash.