OSDN Git Service

Merge branch 'meta_tag_problem' into development
authorDanil Skachkov <danil.skachkov@gmail.com>
Sat, 23 Jul 2011 13:11:27 +0000 (20:11 +0700)
committerDanil Skachkov <danil.skachkov@gmail.com>
Sat, 23 Jul 2011 13:11:27 +0000 (20:11 +0700)
src/cx/fbn/nevernote/evernote/EnmlConverter.java

index 40831bf..f9bb988 100644 (file)
@@ -315,6 +315,14 @@ public class EnmlConverter {
                        newContent = newContent.subSequence(0,endPos) +"/>"+end;\r
                }\r
                \r
+               // Fix the problem that the <meta> tag isn't properly closed\r
+               logger.log(logger.MEDIUM, "Checking meta tags");\r
+               for (int i=newContent.indexOf("<meta"); i>0; i = newContent.indexOf("<meta",i+1)) {\r
+                       endPos = newContent.indexOf(">",i+1);\r
+                       String end = newContent.substring(endPos+1);\r
+                       newContent = newContent.subSequence(0,endPos) +"/>"+end;\r
+               }\r
+               \r
                logger.log(logger.MEDIUM, "Leaving fixStupidXMLProblems");\r
                logger.log(logger.HIGH, "Leaving DBRunner.fixStupidXMLProblems");\r
                return newContent.toString();\r