OSDN Git Service

Correct string out of bounds exception when editing LaTeX formula.
[neighbornote/NeighborNote.git] / src / cx / fbn / nevernote / xml / HtmlTagModifier.java
index 9a4eeeb..6b327cb 100644 (file)
@@ -75,12 +75,13 @@ public class HtmlTagModifier {
        }\r
        \r
        public void replaceValue(int position, String attribute, String newValue) {\r
+\r
                int endPosition = html.indexOf(">", position);\r
                if (endPosition < 0)\r
                        return;\r
                \r
                int attributeStart = html.indexOf(attribute, position);\r
-               if (attributeStart < 0)\r
+               if (attributeStart < 0 || attributeStart > endPosition)\r
                        return;\r
                \r
                int attributeEnd = html.indexOf(" ", attributeStart);\r