Skip to content

Commit bb4f6ff

Browse files
authored
fix: use backticks for example strings containing doublequotes (#1556)
1 parent 176dcd6 commit bb4f6ff

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

smithy-typescript-codegen/src/main/java/software/amazon/smithy/typescript/codegen/documentation/DocumentationExampleGenerator.java

+3
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,9 @@ private static String write(Node node, int indent) {
8484
}
8585
case STRING -> {
8686
StringNode stringNode = node.expectStringNode();
87+
if (stringNode.getValue().contains("\"")) {
88+
return "`" + stringNode.getValue() + "`";
89+
}
8790
return "\"" + stringNode.getValue() + "\"";
8891
}
8992
case NUMBER -> {

0 commit comments

Comments
 (0)