diff --git a/src/turndown.js b/src/turndown.js index 127c76fd..bcd4d60b 100644 --- a/src/turndown.js +++ b/src/turndown.js @@ -9,7 +9,7 @@ var trailingNewLinesRegExp = /\n*$/ var escapes = [ [/\\/g, '\\\\'], [/\*/g, '\\*'], - [/-/g, '\\-'], + [/^-/g, '\\-'], [/^\+ /g, '\\+ '], [/^(=+)/g, '\\$1'], [/^(#{1,6}) /g, '\\$1 '], diff --git a/test/index.html b/test/index.html index 52729b59..b52c5928 100644 --- a/test/index.html +++ b/test/index.html @@ -733,7 +733,7 @@

This is a header.

- - -
-
\- \- \-
+
\- - -
@@ -776,6 +776,11 @@

This is a header.

\+ An unordered list item
+
+
Hello-world, 45 - 3 is 42
+
Hello-world, 45 - 3 is 42
+
+
+1 and another +
+1 and another +
@@ -796,11 +801,6 @@

This is a header.

_test\_italics_
-
-
45 - 3 is 42
-
45 \- 3 is 42
-
-
> Blockquote in markdown
\> Blockquote in markdown
@@ -844,7 +844,7 @@

This is a header.

_Really_? Is that what it _is_? A **2000** year-old computer?

-
\_Really\_? Is that what it \_is\_? A \*\*2000\*\* year\-old computer?
+
\_Really\_? Is that what it \_is\_? A \*\*2000\*\* year-old computer?