jsoup to strip only html tagsnot new line character?

blackfear

New Member
i have below content in java whwre i want to strip only html tags but not new line characters\[code\]<p>test1 <b>test2</b> test 3 </p> //line 1<p>test4 </p> //line 2\[/code\]If i open above content in text rich editor, line 1 and line 2 are displayed in different lines(without showing tag).But in notepad content is shown alongwith tags. To remove all html tags i used \[code\]Jsoup.parse(aboveContent).text()\[/code\]It removes all html characters. But it shows all line 1 and line 2 in same line in notepad. Somehow jsoup also removes newline character.What i tried:- i also tried replacing with "\r\n" and then do to remove html tags\[code\] Jsoup.parse(contentWith\r\n-Insteadof-</p>Tag ).text()\[/code\]but still Jsoup removes end of line character(as in the debugger i can see both line1 and line2) in same line.How i can make jsoup to strip only html character but not new line character?
 
Back
Top