Commit fd60e35d authored by Dennis Hendriks's avatar Dennis Hendriks
Browse files

#204 SvgNameUtils: fix bugs in new data file + extra robustness check.

parent 73a9a881
Pipeline #935 passed with stage
in 0 seconds
......@@ -105,6 +105,7 @@ public class SvgNameUtils {
}
// Process data from file.
Pattern svgElemAttrNameSyntaxPattern = Pattern.compile("[a-zA-Z0-9\\-:]+");
Map<String, Set<String>> mapping = map();
for (String line: lines) {
if (line.isBlank() || line.startsWith("#")) {
......@@ -115,8 +116,8 @@ public class SvgNameUtils {
Assert.check(idx > 0);
String elemName = line.substring(0, idx);
String attrName = line.substring(idx + " / ".length());
Assert.check(elemName.indexOf(" / ") < 0, elemName);
Assert.check(attrName.indexOf(" / ") < 0, attrName);
Assert.check(svgElemAttrNameSyntaxPattern.matcher(elemName).matches(), elemName);
Assert.check(svgElemAttrNameSyntaxPattern.matcher(attrName).matches(), attrName);
// Add to mapping.
Set<String> attrs = mapping.get(elemName);
......
......@@ -656,7 +656,6 @@ color-profile / xlink:type
color-profile / xml:base
color-profile / xml:lang
color-profile / xml:space
color-profile / mapping.put("color-profile",Collections.unmodifiableSet(attrs));
cursor / externalResourcesRequired
cursor / id
......@@ -2318,27 +2317,23 @@ font-face / x-height
font-face / xml:base
font-face / xml:lang
font-face / xml:space
font-face / mapping.put("font-face",Collections.unmodifiableSet(attrs));
font-face-format / id
font-face-format / string
font-face-format / xml:base
font-face-format / xml:lang
font-face-format / xml:space
font-face-format / mapping.put("font-face-format",Collections.unmodifiableSet(attrs));
font-face-name / id
font-face-name / name
font-face-name / xml:base
font-face-name / xml:lang
font-face-name / xml:space
font-face-name / mapping.put("font-face-name",Collections.unmodifiableSet(attrs));
font-face-src / id
font-face-src / xml:base
font-face-src / xml:lang
font-face-src / xml:space
font-face-src / mapping.put("font-face-src",Collections.unmodifiableSet(attrs));
font-face-uri / id
font-face-uri / xlink:actuate
......@@ -2351,7 +2346,6 @@ font-face-uri / xlink:type
font-face-uri / xml:base
font-face-uri / xml:lang
font-face-uri / xml:space
font-face-uri / mapping.put("font-face-uri",Collections.unmodifiableSet(attrs));
foreignObject / alignment-baseline
foreignObject / baseline-shift
......@@ -3168,7 +3162,6 @@ missing-glyph / writing-mode
missing-glyph / xml:base
missing-glyph / xml:lang
missing-glyph / xml:space
missing-glyph / mapping.put("missing-glyph",Collections.unmodifiableSet(attrs));
mpath / externalResourcesRequired
mpath / id
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment