Skip to content

Commit 3190257

Browse files
committed
< and > no longer get replaced by HTML entities
See #61
1 parent bbe77df commit 3190257

File tree

4 files changed

+29
-11
lines changed

4 files changed

+29
-11
lines changed

src/main/java/nl/jworks/markdown_to_asciidoc/ToAsciiDocSerializer.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ public void visit(BulletListNode node) {
114114

115115
public void visit(CodeNode node) {
116116
printer.print('`');
117-
printer.printEncoded(node.getText());
117+
printer.print(node.getText());
118118
printer.print('`');
119119
}
120120

src/test/java/nl/jworks/markdown_to_asciidoc/Stepdefs.java

+5-10
Original file line numberDiff line numberDiff line change
@@ -13,26 +13,21 @@ public class Stepdefs {
1313
private String asciiDoc;
1414

1515
@Given("^the Markdown source$")
16-
public void the_markdown_source(String markdown) throws Throwable {
16+
public void the_markdown_source(String markdown) {
1717
if (markdown.contains("{sp}")) {
18-
this.markdown = markdown.replaceAll("\\{sp\\}", " ");
19-
}
20-
else {
18+
this.markdown = markdown.replaceAll("\\{sp}", " ");
19+
} else {
2120
this.markdown = markdown;
2221
}
2322
}
2423

2524
@When("^it is converted to AsciiDoc")
26-
public void it_is_converted_to_asciidoc() throws Throwable {
27-
// Express the Regexp above with the code you wish you had
25+
public void it_is_converted_to_asciidoc() {
2826
this.asciiDoc = Converter.convertMarkdownToAsciiDoc(markdown.replaceAll("\r\n", "\n"));
2927
}
3028

3129
@Then("^the result should match the AsciiDoc source$")
32-
public void the_result_should_match_the_asciidoc_source(String result) throws Throwable {
33-
// Express the Regexp above with the code you wish you had
34-
30+
public void the_result_should_match_the_asciidoc_source(String result) {
3531
assertEquals(result.replaceAll("\r\n", "\n"), asciiDoc.replaceAll("\r\n", "\n"));
36-
3732
}
3833
}

src/test/resources/nl/jworks/markdown_to_asciidoc/headings.feature

+12
Original file line numberDiff line numberDiff line change
@@ -105,3 +105,15 @@ Feature: Headings
105105
"""
106106
= Title
107107
"""
108+
109+
# Doesn't work. See https://github.com/markdown-asciidoc/markdown-to-asciidoc/issues/60
110+
# Scenario: Render a heading with backticks
111+
# Given the Markdown source
112+
# """
113+
## `what.ever.Foo`
114+
# """
115+
# When it is converted to AsciiDoc
116+
# Then the result should match the AsciiDoc source
117+
# """
118+
# === `what.ever.Foo`
119+
# """

src/test/resources/nl/jworks/markdown_to_asciidoc/paragraphs.feature

+11
Original file line numberDiff line numberDiff line change
@@ -43,3 +43,14 @@ Feature: Paragraphs
4343
4444
Second paragraph.
4545
"""
46+
47+
Scenario: Render special characters as is
48+
Given the Markdown source
49+
"""
50+
This is an example: `Provider<List<File>>`
51+
"""
52+
When it is converted to AsciiDoc
53+
Then the result should match the AsciiDoc source
54+
"""
55+
This is an example: `Provider<List<File>>`
56+
"""

0 commit comments

Comments
 (0)