mirror of
https://github.com/leanote/leanote-android.git
synced 2025-10-14 14:10:56 +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.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
import okio.BufferedSink;
|
||||
import okio.Okio;
|
||||
@@ -93,7 +94,7 @@ public class HtmlImporter {
|
||||
preElement.addClass("ace-tomorrow");
|
||||
removeClassLike(preElement, "brush:\\w+");
|
||||
//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");
|
||||
} else {
|
||||
preElement.addClass("brush:convert");
|
||||
|
Reference in New Issue
Block a user