daily pastebin goal
1%
SHARE
TWEET

Wish: convert &entities but NOT html tags.

nicola Jun 2nd, 2011 113 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. It would be great to have something which converts anything BUT html tags, for instance:
  2.  
  3. <p>Inició sus estudios en la escuela <a href="www.whatever.org">school name</a> y se recibió <i>magna cum laude</i> en etc. etc..</p>
  4.  
  5. would NOT become:
  6.  
  7. &lt;p&gt;Inici&oacute; sus estudios en la escuela &lt;a href=&quot;www.whatever.org&quot;&gt;school name&lt;/a&gt; y se recibi&oacute; &lt;i&gt;magna cum laude&lt;/i&gt; en etc. etc..&lt;/p&gt;
  8.  
  9. BUT INSTEAD:
  10.  
  11. <p>Inici&oacute; sus estudios en la escuela <a href="www.whatever.org">school name</a> y se recibi&oacute; <i>magna cum laude</i> en etc. etc..</p>
  12.  
  13. to which result anyway one can get by putting the unwanted result into any text editor and replacing all occurrences of
  14.  
  15. &lt; with <
  16. &gt; with >
  17. &quot; with "
  18.  
  19.  
  20. I came to need something like this because I saved one page with google chrome (*) without noticing that it had replaced &entities of the page code by single characters which were NOT in the original page code, &oacute; with ó, &aacute; with á, etc., and I started comfortably editing the text in between html tags (the original text I was translating was carrying links that I wanted to respect in the translation).
  21.  
  22. When I realized, I couldn't figure out a quick way to resolve the conversion inside Notepad++ (at least not with the plugins I took the time to investigate), I found this page (thanks) and I ended up using http://www.elliotswan.com/postable/ and then notepad to convert back to single character any occurrence of the above mentioned &entities, to recover <>", that is to recover html tags and quotes around linked URLs.
  23.  
  24.  
  25. (*) Saving with ctrl-S, instead of grabbing the original archive by putting it as the target of a link and do "save link target as ...", can also cause a change in the path of related files, images or css style sheets or whatever.
  26. I hadn't considered this as an issue at first, because I just needed to translate two text parts and send the html code of each part ready for the webmaster to replace each part into the original page. (Anyway I ended up grabbing the untouched original page and offering him both options, parts to paste or already patched page.)
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top