I need to transform strings one into another.
An example is:
#Fashion #Helmet #Woman #Scifi [  ](http://bit.ly/P1omax) Rob Goodwin
That has to be transformed into the HTML code:
#Fashion #Helmet #Woman #Scifi<a href="http://bit.ly/P1omax"><img src="http://24.media.tumblr.com/tumblr_mbv08xkdzy1qfzis2o1_1280.gif" /></a>
Is there a Java library that does that?
UPDATE
It looks very similar to Markdown. But processing it with markdownj produces a messy HTML:
<h1>Fashion #Helmet #Woman #Scifi</h1>
<p><a href="a href="http://24.media.tumblr.com/tumblr_mbv08xkdzy1qfzis2o1_1280.gif">http://24.media.tumblr.com/tumblr_mbv08xkdzy1qfzis2o1_1280.gif</a"> <img src="<a href="http://bit.ly/P1omax">http://bit.ly/P1omax</a>" alt="t</a> " />
Rob Goodwin</p>
UPDATE 2
All three Java libraries that allow to transform Markdown into HTML have problems recognising images inside links.
The approach that I decided to use is a two-step approach:
- run your library;
- use Java code to correct the errors.
It is not an ideal solution, but it works.
Is the inputstring markdown? Yes it works in http://daringfireball.net/projects/markdown/dingus which generates
Therefore: http://code.google.com/p/markdownj/
Or: http://en.wikipedia.org/wiki/List_of_Markdown_implementations
https://github.com/sirthias/pegdown looks ok. they claim: