kalyan_au_cse 0 Newbie Poster

Hi,

I have project where a part is to make a maven 2 plugin for files to escape HTML content and generate a new file. I did it, to do this I used apache-commons-lang 2.4 library. But there is a new requirement now. They want to use it on a web browser and the files generated also escape html links (i.e., href) which sould not be done, or else the browser won't take it as a link. That is at present, the following conversion is taking place which should not.

<a href="http://blah_blah.html" target="_blank">Learn more</a> about where your traffic is coming from.

&lt;a href=&quot;http://blah_blah.html&quot; target=&quot;_blank&quot;&gt;Learn more&lt;/a&gt; about where your traffic is coming from.

Now its like i have to escape all other content except links. There is a unescape method also, but the bsiac problem is that i cant figure out where to apply it. the plugin should be very generic to see as any content you throw at it shouls escape all content except hyperlink. Noe this is difficult as i don't know how the guy who is going to write its input will write. Its not that the link will be on a seperate line. It may be mixed up with other content on either sides that i have to escape but not the link. Figuring out the link exactly is becoming a problem, as i dont know they way the guy is going to write it, and i don't literally wan't to write a HTML parser.

Can anyone help me with some ideas.