We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
When HTML contains CDATA or comments the display is wrong. Reason is that in this case the ">" is handled twice. Following patch solves the issues.
The text was updated successfully, but these errors were encountered:
Index: src/net/boplicity/xmleditor/XmlView.java =================================================================== --- src/net/boplicity/xmleditor/XmlView.java (Revision 33275) +++ src/net/boplicity/xmleditor/XmlView.java (Arbeitskopie) @@ -17,6 +17,7 @@ import java.awt.Color; import java.awt.Graphics; +import java.util.Collection; import java.util.LinkedHashMap; import java.util.Map; import java.util.SortedMap; @@ -62,8 +63,6 @@ patternColors.put(Pattern.compile(TAG_CDATA), Color.GRAY); patternColors.put(Pattern.compile(TAG_ATTRIBUTE_PATTERN), new Color( 127, 0, 127)); - patternColors.put(Pattern.compile(TAG_END_PATTERN), new Color(63, 127, - 127)); patternColors.put(Pattern.compile(TAG_ATTRIBUTE_VALUE), new Color(42, 0, 255)); patternColors.put(Pattern.compile(TAG_COMMENT), Color.BLUE); @@ -103,7 +102,18 @@ colorMap.put(matcher.start(1), entry.getValue()); } } + /* Fix end tag duplication for CDATA and comments */ + Matcher matcher = Pattern.compile(TAG_END_PATTERN).matcher(text); + Color c = new Color(63, 127, 127); + Collection<Integer> ends = startMap.values(); + while (matcher.find()) { + if(!ends.contains(matcher.end())) { + startMap.put(matcher.start(1), matcher.end()); + colorMap.put(matcher.start(1), c); + } + } + // TODO: check the map for overlapping parts int i = 0;
Index: src/net/boplicity/xmleditor/XmlView.java
===================================================================
--- src/net/boplicity/xmleditor/XmlView.java (Revision 33275)
+++ src/net/boplicity/xmleditor/XmlView.java (Arbeitskopie)
@@ -17,6 +17,7 @@
import java.awt.Color;
import java.awt.Graphics;
+import java.util.Collection;
import java.util.LinkedHashMap;
import java.util.Map;
import java.util.SortedMap;
@@ -62,8 +63,6 @@
patternColors.put(Pattern.compile(TAG_CDATA), Color.GRAY);
patternColors.put(Pattern.compile(TAG_ATTRIBUTE_PATTERN), new Color(
127, 0, 127));
- patternColors.put(Pattern.compile(TAG_END_PATTERN), new Color(63, 127,
- 127));
patternColors.put(Pattern.compile(TAG_ATTRIBUTE_VALUE), new Color(42,
0, 255));
patternColors.put(Pattern.compile(TAG_COMMENT), Color.BLUE);
@@ -103,7 +102,18 @@
colorMap.put(matcher.start(1), entry.getValue());
}
+ /* Fix end tag duplication for CDATA and comments */
+ Matcher matcher = Pattern.compile(TAG_END_PATTERN).matcher(text);
+ Color c = new Color(63, 127, 127);
+ Collection<Integer> ends = startMap.values();
+ while (matcher.find()) {
+ if(!ends.contains(matcher.end())) {
+ startMap.put(matcher.start(1), matcher.end());
+ colorMap.put(matcher.start(1), c);
+ }
+
// TODO: check the map for overlapping parts
int i = 0;
Sorry, something went wrong.
Aaargh. This Ticket interface is awful, here is a link: https://trac.openstreetmap.org/changeset/33276/subversion?format=diff&new=33276
kdekooter
No branches or pull requests
When HTML contains CDATA or comments the display is wrong. Reason is that in this case the ">" is handled twice. Following patch solves the issues.
The text was updated successfully, but these errors were encountered: