fix problem with value set anchor generation when rendering
This commit is contained in:
parent
128f3733e2
commit
980f88ea49
|
@ -278,10 +278,11 @@ public class DataRenderer extends Renderer implements CodeResolver {
|
|||
String s = codeSystem+'-'+code;
|
||||
StringBuilder b = new StringBuilder();
|
||||
for (char c : s.toCharArray()) {
|
||||
if (Character.isAlphabetic(c) || Character.isDigit(c) || c == '.')
|
||||
if (Utilities.isValidHtmlAnchorChar(c)) {
|
||||
b.append(c);
|
||||
else
|
||||
b.append('-');
|
||||
} else {
|
||||
b.append("|"+Integer.toHexString(c)); // not % to save double coding confusing users
|
||||
}
|
||||
}
|
||||
return b.toString();
|
||||
}
|
||||
|
|
|
@ -809,7 +809,8 @@ public class ValueSetRenderer extends TerminologyRenderer {
|
|||
XhtmlNode td = tr.td();
|
||||
|
||||
String tgt = makeAnchor(c.getSystem(), c.getCode());
|
||||
td.an(res.getScopedId()+"-"+context.prefixAnchor(tgt));
|
||||
String pfx = res.getScopedId();
|
||||
td.an((context.prefixAnchor(pfx == null ? "" : pfx+"-")+tgt));
|
||||
|
||||
if (doLevel) {
|
||||
td.addText(Integer.toString(i));
|
||||
|
|
|
@ -2254,4 +2254,34 @@ public class Utilities {
|
|||
}
|
||||
}
|
||||
|
||||
public static boolean isValidHtmlAnchorChar(char c) {
|
||||
if ( (c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z') || (c >= '0' && c <= '9')) {
|
||||
return true;
|
||||
}
|
||||
switch (c) {
|
||||
case '!':
|
||||
case '$':
|
||||
case '&':
|
||||
case '\'':
|
||||
case '(':
|
||||
case ')':
|
||||
case '*':
|
||||
case '+':
|
||||
case ',':
|
||||
case ';':
|
||||
case '=':
|
||||
case '.':
|
||||
case '_':
|
||||
case '-':
|
||||
case '~':
|
||||
case ':':
|
||||
case '@':
|
||||
case '/':
|
||||
case '?':
|
||||
return true;
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue