mirror of
https://github.com/hapifhir/org.hl7.fhir.core.git
synced 2025-03-09 14:31:17 +00:00
Fix Turtle syntax errors with multiline comments.
This commit is contained in:
parent
97772ada1e
commit
c3580528bb
@ -472,7 +472,7 @@ public class Turtle {
|
|||||||
writer.ln();
|
writer.ln();
|
||||||
if (!section.comments.isEmpty()) {
|
if (!section.comments.isEmpty()) {
|
||||||
for (String s : section.comments) {
|
for (String s : section.comments) {
|
||||||
writer.ln("# "+s);
|
writer.ln("# "+formatMultilineComment(s));
|
||||||
}
|
}
|
||||||
writer.ln();
|
writer.ln();
|
||||||
}
|
}
|
||||||
@ -508,7 +508,7 @@ public class Turtle {
|
|||||||
writer.write("]");
|
writer.write("]");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
String comment = p.comment == null? "" : " # "+p.comment;
|
String comment = p.comment == null? "" : " # "+formatMultilineComment(p.comment);
|
||||||
if (p.asList) writer.write(" )");
|
if (p.asList) writer.write(" )");
|
||||||
i++;
|
i++;
|
||||||
if (i < sbj.predicates.size())
|
if (i < sbj.predicates.size())
|
||||||
@ -521,6 +521,11 @@ public class Turtle {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private String formatMultilineComment(String s) {
|
||||||
|
return s.replace("\n", "\n#");
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
private void commitSection(StringBuilder b, Section section) throws Exception {
|
private void commitSection(StringBuilder b, Section section) throws Exception {
|
||||||
b.append("# - "+section.name+" "+Utilities.padLeft("", '-', 75-section.name.length())+"\r\n");
|
b.append("# - "+section.name+" "+Utilities.padLeft("", '-', 75-section.name.length())+"\r\n");
|
||||||
@ -558,7 +563,7 @@ public class Turtle {
|
|||||||
b.append("]");
|
b.append("]");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
String comment = p.comment == null? "" : " # "+p.comment;
|
String comment = p.comment == null? "" : " # "+formatMultilineComment(p.comment);
|
||||||
if (p.asList) b.append(" )");
|
if (p.asList) b.append(" )");
|
||||||
i++;
|
i++;
|
||||||
if (i < sbj.predicates.size())
|
if (i < sbj.predicates.size())
|
||||||
|
Loading…
x
Reference in New Issue
Block a user