Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/android/181.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Android jsoup多行HTML作为单行返回(无中断返回)_Android_Html_Newline_Jsoup - Fatal编程技术网

Android jsoup多行HTML作为单行返回(无中断返回)

Android jsoup多行HTML作为单行返回(无中断返回),android,html,newline,jsoup,Android,Html,Newline,Jsoup,我有一个HTML,我正在努力清理: <textarea name="notes" rows="5" cols="60">some notes go here and more including a blank line: and another new line etc etc </textarea> 但它以单行的形式返回,而我想在editText中显示结果,如下所示: some notes go he

我有一个HTML,我正在努力清理:

    <textarea name="notes" rows="5" cols="60">some notes go here
    and more including a blank line:

    and another new
    line
    etc
    etc
    </textarea>
但它以单行的形式返回,而我想在editText中显示结果,如下所示:

    some notes go here
    and more including a blank line:

    and another new
    line
    etc
    etc
试试这个:

Element notes = doc.select("textarea[name=notes]").first();
String notesStr = notes.getWholeText();

getWholeText():获取此文本节点的(未编码)文本,包括原始文本中的任何换行符和空格。

您使用的是什么版本的JSoup?用1.7.2测试,我的输出是换行。我也在用1.7.2!典型的发现问题后不久,张贴,我保存所有的HTML到一个文件首先…它是被附加没有行返回!
Element notes = doc.select("textarea[name=notes]").first();
String notesStr = notes.getWholeText();