mirror of
https://github.com/leanote/leanote-android.git
synced 2025-10-16 15:28:38 +00:00
fix condition of xml-like code detection
This commit is contained in:
@@ -18,6 +18,7 @@ import java.io.File;
|
|||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.regex.Pattern;
|
||||||
|
|
||||||
import okio.BufferedSink;
|
import okio.BufferedSink;
|
||||||
import okio.Okio;
|
import okio.Okio;
|
||||||
@@ -93,7 +94,7 @@ public class HtmlImporter {
|
|||||||
preElement.addClass("ace-tomorrow");
|
preElement.addClass("ace-tomorrow");
|
||||||
removeClassLike(preElement, "brush:\\w+");
|
removeClassLike(preElement, "brush:\\w+");
|
||||||
//to be compatible with desktop app, https://github.com/leanote/desktop-app/issues/192
|
//to be compatible with desktop app, https://github.com/leanote/desktop-app/issues/192
|
||||||
if (codeHtml.matches("<.+>")) {
|
if (Pattern.compile("<.+>").matcher(codeHtml).find()) {
|
||||||
preElement.addClass("brush:html");
|
preElement.addClass("brush:html");
|
||||||
} else {
|
} else {
|
||||||
preElement.addClass("brush:convert");
|
preElement.addClass("brush:convert");
|
||||||
|
Reference in New Issue
Block a user