mirror of
https://github.com/leanote/leanote-android.git
synced 2025-10-14 14:10:56 +00:00
to be compatible with desktop app, remove the <code> element which is the only child of <pre>
This commit is contained in:
@@ -76,6 +76,16 @@ public class HtmlImporter {
|
||||
}
|
||||
}
|
||||
|
||||
for (Element preElement : document.body().select("pre")) {
|
||||
Elements children = preElement.children();
|
||||
if (children.size() == 1 && "code".equals(children.first().nodeName())) {
|
||||
Element codeElement = children.first();
|
||||
String codeHtml = codeElement.html();
|
||||
codeElement.remove();
|
||||
preElement.html(codeHtml);
|
||||
}
|
||||
}
|
||||
|
||||
if (mShouldRemoveAttributes) {
|
||||
for (Element element : document.body().select(NORMAL_TAGS)) {
|
||||
removeElementsAttributes(element);
|
||||
|
Reference in New Issue
Block a user