jsoup-1.5.2 parse html tag stringを使用しています。html文字列からプレーンテキストを抽出し、テキストの長さを指定して、そのままのhtmlタグを保持したいと思います。
例:
htmlコード:
<p><span>Mike <u>stopp<b>ed</b></u> his work</span></p>
結果が欲しい:
テキストの長さを指定=4
result:<p><span>Mike</span></p>
テキストの長さ=10を指定します
result:<p><span>Mike <u>stopp</u></span></p>
テキストの長さを指定=12
result:<p><span>Mike <u>stopp<b>ed</b></u></span></p>
テキストの長さを指定=16
result:<p><span>Mike <u>stopp<b>ed</b></u> his</span></p>
等
jsoupを使って仕上げることはできますか?