Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -275,7 +275,7 @@ public void onBlockQuoteEnd() {

@Override
public void onSimpleText(String value) {
value = value.replace("---", "—");
value = value.replace("---", "—").replace("--", "–");
append(DocElementType.SIMPLE_TEXT, "text", value);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -354,6 +354,18 @@ world""")
content.should == [[type: 'Paragraph', content:[[text: 'hello — world', type: 'SimpleText']]]]
}

@Test
void "double dash as en dash"() {
parse("pages 10 -- 20")
content.should == [[type: 'Paragraph', content:[[text: 'pages 10 – 20', type: 'SimpleText']]]]
}

@Test
void "em dash takes precedence over en dash"() {
parse("em --- and en -- together")
content.should == [[type: 'Paragraph', content:[[text: 'em — and en – together', type: 'SimpleText']]]]
}

@Test
void "include plugin error should provide context of the plugin"() {
code {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* Add: Use `--` for en-dash
Loading