Skip to content

Commit a37c3d2

Browse files
committed
README: Don't use escapeHtml(true) in example
This keeps the output closer to the spec.
1 parent 48f05b3 commit a37c3d2

1 file changed

Lines changed: 7 additions & 6 deletions

File tree

README.md

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -48,16 +48,17 @@ import org.commonmark.parser.Parser;
4848

4949
Parser parser = Parser.builder().build();
5050
Node document = parser.parse("This is *Sparta*");
51-
HtmlRenderer renderer = HtmlRenderer.builder().escapeHtml(true).build();
51+
HtmlRenderer renderer = HtmlRenderer.builder().build();
5252
renderer.render(document); // "<p>This is <em>Sparta</em></p>\n"
5353
```
5454

55-
This uses the parser and renderer with default options, except for escaping raw
56-
HTML tags and blocks. For all the available options, see other methods on the
57-
builder objects.
55+
This uses the parser and renderer with default options. Both builders have
56+
methods for configuring their behavior, e.g. calling `escapeHtml(true)` on
57+
`HtmlRenderer` will escape raw HTML tags and blocks. For all available
58+
options, see methods on the builders.
5859

59-
Note that this library doesn't try to sanitize HTML; that is the responsibility
60-
of the caller.
60+
Note that this library doesn't try to sanitize the resulting HTML; that is
61+
the responsibility of the caller.
6162

6263
#### Use a visitor to process parsed nodes
6364

0 commit comments

Comments
 (0)