diff --git a/dist/showdown.js b/dist/showdown.js index 5f8e155..d94c5fe 100644 Binary files a/dist/showdown.js and b/dist/showdown.js differ diff --git a/dist/showdown.js.map b/dist/showdown.js.map index 7dc755d..6f1cf4f 100644 Binary files a/dist/showdown.js.map and b/dist/showdown.js.map differ diff --git a/dist/showdown.min.js b/dist/showdown.min.js index 3d3d5ca..093ff64 100644 Binary files a/dist/showdown.min.js and b/dist/showdown.min.js differ diff --git a/dist/showdown.min.js.map b/dist/showdown.min.js.map index 283e7a6..401fca0 100644 Binary files a/dist/showdown.min.js.map and b/dist/showdown.min.js.map differ diff --git a/src/subParsers/lists.js b/src/subParsers/lists.js index 6df1f08..1278bfc 100644 --- a/src/subParsers/lists.js +++ b/src/subParsers/lists.js @@ -112,7 +112,7 @@ showdown.subParser('lists', function (text, options, globals) { var pos = txt.search(counterRxg); if (pos !== -1) { // slice - result += '\n\n<' + listType + '>' + processListItems(txt.slice(0, pos), !!trimTrailing) + '\n\n'; + result += '\n<' + listType + '>' + processListItems(txt.slice(0, pos), !!trimTrailing) + '\n'; // invert counterType and listType listType = (listType === 'ul') ? 'ol' : 'ul'; @@ -121,14 +121,14 @@ showdown.subParser('lists', function (text, options, globals) { //recurse parseCL(txt.slice(pos)); } else { - result += '\n\n<' + listType + '>' + processListItems(txt, !!trimTrailing) + '\n\n'; + result += '\n<' + listType + '>' + processListItems(txt, !!trimTrailing) + '\n'; } })(list); for (var i = 0; i < subLists.length; ++i) { } } else { - result = '\n\n<' + listType + '>' + processListItems(list, !!trimTrailing) + '\n\n'; + result = '\n<' + listType + '>' + processListItems(list, !!trimTrailing) + '\n'; } return result; diff --git a/src/subParsers/paragraphs.js b/src/subParsers/paragraphs.js index 25bec4a..5ab37ea 100644 --- a/src/subParsers/paragraphs.js +++ b/src/subParsers/paragraphs.js @@ -58,7 +58,7 @@ showdown.subParser('paragraphs', function (text, options, globals) { } grafsOut[i] = grafsOutIt; } - text = grafsOut.join('\n\n'); + text = grafsOut.join('\n'); // Strip leading and trailing lines: text = text.replace(/^\n+/g, ''); text = text.replace(/\n+$/g, ''); diff --git a/test/cases/blockquote-followed-by-code.html b/test/cases/blockquote-followed-by-code.html index 5cae32b..0f48cab 100644 --- a/test/cases/blockquote-followed-by-code.html +++ b/test/cases/blockquote-followed-by-code.html @@ -2,12 +2,9 @@

a blockquote with a 4 space indented line (not code)

-

sep

-

a blockquote

-
with some code after
 
diff --git a/test/cases/blockquote-inside-code.html b/test/cases/blockquote-inside-code.html index 038924a..b46311f 100644 --- a/test/cases/blockquote-inside-code.html +++ b/test/cases/blockquote-inside-code.html @@ -1,9 +1,7 @@
> this is a pseudo blockquote
     > inside a code block
 
-

foo

-
> this is another bq
     inside code
 
diff --git a/test/cases/blockquote-nested-markdown.html b/test/cases/blockquote-nested-markdown.html index 4e92825..ff8791d 100644 --- a/test/cases/blockquote-nested-markdown.html +++ b/test/cases/blockquote-nested-markdown.html @@ -1,14 +1,11 @@

This is a header.

-
  1. This is the first list item.
  2. This is the second list item.
-

Here's some example code:

-
return shell_exec("echo $input | $markdown_script");
     
diff --git a/test/cases/blockquote.html b/test/cases/blockquote.html index c74d3f6..0b47c63 100644 --- a/test/cases/blockquote.html +++ b/test/cases/blockquote.html @@ -1,5 +1,4 @@

This is a multi line blockquote test

-

With more than one line.

diff --git a/test/cases/code-block-html-escape.html b/test/cases/code-block-html-escape.html index 028f874..770e126 100644 --- a/test/cases/code-block-html-escape.html +++ b/test/cases/code-block-html-escape.html @@ -1,4 +1,3 @@

This is some HTML:

-
<h1>Heading</h1>
 
diff --git a/test/cases/code-block.html b/test/cases/code-block.html index 3e56099..56bc5d0 100644 --- a/test/cases/code-block.html +++ b/test/cases/code-block.html @@ -1,4 +1,3 @@

This is a normal paragraph:

-
This is a code block.
 
diff --git a/test/cases/emphasis.html b/test/cases/emphasis.html index e33c510..6ced7c6 100644 --- a/test/cases/emphasis.html +++ b/test/cases/emphasis.html @@ -1,66 +1,34 @@

single asterisks

-

single underscores

-

double asterisks

-

double underscores

-

text with italic sentence in middle

-

text with bold sentence in middle

-

text with bold text that spans across multiple lines

-

underscored_word

-

doubleunderscore__word

-

asterix*word

-

doubleasterix**word

-

line with_underscored word

-

line with__doubleunderscored word

-

line with*asterixed word

-

line with**doubleasterixed word

-

some linewithinner underscores

-

some linewithinner double underscores

-

some linewithinner asterixs

-

some linewithinner double asterixs

-

another line with just _one underscore

-

another line with just __one double underscore

-

another line with just *one asterix

-

another line with just **one double asterix

-

a sentence withunderscore and anotherunderscore

-

a sentence withdoubleunderscore and anotherdoubleunderscore

-

a sentence withasterix and anotherasterix

-

a sentence withdoubleasterix and anotherdoubleasterix

-

escaped word_with_underscores

-

escaped word__with__double underscores

-

escaped word_with_single italic underscore

-

escaped word*with*asterixs

-

escaped word**with**asterixs

-

escaped word*with*bold asterixs

diff --git a/test/cases/escaping.html b/test/cases/escaping.html index 1ac6a29..80a0ddb 100644 --- a/test/cases/escaping.html +++ b/test/cases/escaping.html @@ -1,31 +1,16 @@

These should all be escaped:

-

\

-

`

-

*

-

_

-

{

-

}

-

[

-

]

-

(

-

)

-

#

-

+

-

-

-

.

-

!

diff --git a/test/cases/github-style-at-start.html b/test/cases/github-style-at-start.html index 5cfec09..79c0044 100644 --- a/test/cases/github-style-at-start.html +++ b/test/cases/github-style-at-start.html @@ -2,5 +2,4 @@ // ... } -

That is some code!

diff --git a/test/cases/github-style-codeblock-inside-quote.html b/test/cases/github-style-codeblock-inside-quote.html index 85fa51c..2800050 100644 --- a/test/cases/github-style-codeblock-inside-quote.html +++ b/test/cases/github-style-codeblock-inside-quote.html @@ -1,14 +1,11 @@

Define a function in javascript:

-
function MyFunc(a) {
   var s = '`';
   }
 
-

And some nested quote

-
<div>HTML!</div>
 
diff --git a/test/cases/github-style-codeblock.html b/test/cases/github-style-codeblock.html index 8d593ae..4dc42a2 100644 --- a/test/cases/github-style-codeblock.html +++ b/test/cases/github-style-codeblock.html @@ -1,11 +1,8 @@

Define a function in javascript:

-
function MyFunc(a) {
   var s = '`';
   }
 
-

And some HTML

-
<div>HTML!</div>
 
diff --git a/test/cases/horizontal-rules.html b/test/cases/horizontal-rules.html index aaef23e..52f2479 100644 --- a/test/cases/horizontal-rules.html +++ b/test/cases/horizontal-rules.html @@ -1,9 +1,5 @@
-
-
-
-
diff --git a/test/cases/html-comments.html b/test/cases/html-comments.html index 865f2e5..37fa245 100644 --- a/test/cases/html-comments.html +++ b/test/cases/html-comments.html @@ -1,14 +1,8 @@ - -

words words

- -

words

- -
<!-- comment -->
 
diff --git a/test/cases/html-inside-listed-code.html b/test/cases/html-inside-listed-code.html index 3a1e09b..31001d9 100644 --- a/test/cases/html-inside-listed-code.html +++ b/test/cases/html-inside-listed-code.html @@ -1,6 +1,5 @@ \ No newline at end of file diff --git a/test/issues/#220.html-breaks-markdown-parsing.html b/test/issues/#220.html-breaks-markdown-parsing.html index 0084c9d..66439cb 100644 --- a/test/issues/#220.html-breaks-markdown-parsing.html +++ b/test/issues/#220.html-breaks-markdown-parsing.html @@ -1,8 +1,5 @@

Title 1

-
-

Title 2

-
diff --git a/test/issues/#229.2.code-being-parsed-inside-HTML-code-tags.html b/test/issues/#229.2.code-being-parsed-inside-HTML-code-tags.html index dff2c46..53c8243 100644 --- a/test/issues/#229.2.code-being-parsed-inside-HTML-code-tags.html +++ b/test/issues/#229.2.code-being-parsed-inside-HTML-code-tags.html @@ -8,11 +8,8 @@ alert(s); bar
-

this is a long paragraph

-

this is another long paragraph

-
```javascript
 var s = "JavaScript syntax highlighting";
 alert(s);
diff --git a/test/issues/#230.paragraphs-are-ignored-between-code-tags.html b/test/issues/#230.paragraphs-are-ignored-between-code-tags.html
index 1f2492a..9ce90ea 100644
--- a/test/issues/#230.paragraphs-are-ignored-between-code-tags.html
+++ b/test/issues/#230.paragraphs-are-ignored-between-code-tags.html
@@ -2,9 +2,7 @@
 var s;
 ```
 
-

this is a long paragraph

-

 ```javascript
 var s;
diff --git a/test/issues/#261.mix-images-with-links.html b/test/issues/#261.mix-images-with-links.html
index 52617da..7d1b326 100644
--- a/test/issues/#261.mix-images-with-links.html
+++ b/test/issues/#261.mix-images-with-links.html
@@ -1,17 +1,9 @@
 

sd-inline sd-ref

-

foo

-

sd-inline sd-ref

-

foo

-

sd-ref sd-inline

-

foo

-

sd-ref sd-inline

-

foo

-

sd-ref

diff --git a/test/issues/#261.reference-style-image-after-inline-style-image-does-not-work-correctely.html b/test/issues/#261.reference-style-image-after-inline-style-image-does-not-work-correctely.html index 11a7a74..117f37d 100644 --- a/test/issues/#261.reference-style-image-after-inline-style-image-does-not-work-correctely.html +++ b/test/issues/#261.reference-style-image-after-inline-style-image-does-not-work-correctely.html @@ -1,5 +1,3 @@

sd-inline sd-ref

-

foo

-

sd-ref sd-inline

diff --git a/test/issues/#261.reference-style-link-after-inline-style-link-does-not-work-correctely.html b/test/issues/#261.reference-style-link-after-inline-style-link-does-not-work-correctely.html index eda7d4b..13bb32f 100644 --- a/test/issues/#261.reference-style-link-after-inline-style-link-does-not-work-correctely.html +++ b/test/issues/#261.reference-style-link-after-inline-style-link-does-not-work-correctely.html @@ -1,5 +1,3 @@

sd-inline sd-ref

-

foo

-

sd-ref sd-inline

diff --git a/test/issues/#288.code-blocks-containing-xml-comments-are-not-converted-correctly-when-nested-in-list-items.html b/test/issues/#288.code-blocks-containing-xml-comments-are-not-converted-correctly-when-nested-in-list-items.html index 5855544..d0b2e96 100644 --- a/test/issues/#288.code-blocks-containing-xml-comments-are-not-converted-correctly-when-nested-in-list-items.html +++ b/test/issues/#288.code-blocks-containing-xml-comments-are-not-converted-correctly-when-nested-in-list-items.html @@ -1,6 +1,5 @@
  • list item 1

    -
    <parent>
     <child>child1</child>
     <!-- This is a comment -->
    @@ -11,7 +10,6 @@
     
        
  • list item 2

-
<parent>
 <child>child1</child>
 <!-- This is a comment -->
diff --git a/test/issues/#83.parsed-text-links-with-underscores.html b/test/issues/#83.parsed-text-links-with-underscores.html
index 892e412..8d6f94b 100644
--- a/test/issues/#83.parsed-text-links-with-underscores.html
+++ b/test/issues/#83.parsed-text-links-with-underscores.html
@@ -1,5 +1,3 @@
 

plain text link http://test.com/this_has/one.html with underscores

-

legit·word_with·1·underscore

-

a wordwith2underscores (gets em)

diff --git a/test/issues/#96.underscores-in-links.html b/test/issues/#96.underscores-in-links.html index 273dcb9..975c4f5 100644 --- a/test/issues/#96.underscores-in-links.html +++ b/test/issues/#96.underscores-in-links.html @@ -1,3 +1,2 @@

this is a underscore_test my cat

-

another my cat underscore_test bla

diff --git a/test/karlcow/2-paragraphs-hard-return-spaces.html b/test/karlcow/2-paragraphs-hard-return-spaces.html index ed211e1..7c095bb 100644 --- a/test/karlcow/2-paragraphs-hard-return-spaces.html +++ b/test/karlcow/2-paragraphs-hard-return-spaces.html @@ -1,5 +1,4 @@

This is a first paragraph, on multiple lines.

-

This is a second paragraph. There are spaces in between the two.

\ No newline at end of file diff --git a/test/karlcow/2-paragraphs-hard-return.html b/test/karlcow/2-paragraphs-hard-return.html index 5da1c69..a2d0808 100644 --- a/test/karlcow/2-paragraphs-hard-return.html +++ b/test/karlcow/2-paragraphs-hard-return.html @@ -1,5 +1,4 @@

This is a first paragraph, on multiple lines.

-

This is a second paragraph which has multiple lines too.

\ No newline at end of file diff --git a/test/karlcow/2-paragraphs-line-returns.html b/test/karlcow/2-paragraphs-line-returns.html index 89f0e94..87f33f6 100644 --- a/test/karlcow/2-paragraphs-line-returns.html +++ b/test/karlcow/2-paragraphs-line-returns.html @@ -1,3 +1,2 @@

A first paragraph.

-

A second paragraph after 3 CR (carriage return).

\ No newline at end of file diff --git a/test/karlcow/2-paragraphs-line-spaces.html b/test/karlcow/2-paragraphs-line-spaces.html index 39270cc..601651d 100644 --- a/test/karlcow/2-paragraphs-line-spaces.html +++ b/test/karlcow/2-paragraphs-line-spaces.html @@ -1,3 +1,2 @@

This a very long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long paragraph on 1 line.

-

A few spaces and a new long long long long long long long long long long long long long long long long paragraph on 1 line.

\ No newline at end of file diff --git a/test/karlcow/2-paragraphs-line-tab.html b/test/karlcow/2-paragraphs-line-tab.html index 6ba5a11..1f53564 100644 --- a/test/karlcow/2-paragraphs-line-tab.html +++ b/test/karlcow/2-paragraphs-line-tab.html @@ -1,3 +1,2 @@

This a very long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long paragraph on 1 line.

-

1 tab to separate them and a new long long long long long long long long long long long long long long long long paragraph on 1 line.

\ No newline at end of file diff --git a/test/karlcow/2-paragraphs-line.html b/test/karlcow/2-paragraphs-line.html index 8812518..07aba47 100644 --- a/test/karlcow/2-paragraphs-line.html +++ b/test/karlcow/2-paragraphs-line.html @@ -1,3 +1,2 @@

This a very long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long paragraph on 1 line.

-

A new long long long long long long long long long long long long long long long long paragraph on 1 line.

\ No newline at end of file diff --git a/test/karlcow/EOL-CR+LF.html b/test/karlcow/EOL-CR+LF.html index c236b1d..49afea4 100644 --- a/test/karlcow/EOL-CR+LF.html +++ b/test/karlcow/EOL-CR+LF.html @@ -1,5 +1,3 @@

These lines all end with end of line (EOL) sequences.

-

Seriously, they really do.

-

If you don't believe me: HEX EDIT!

\ No newline at end of file diff --git a/test/karlcow/EOL-CR.html b/test/karlcow/EOL-CR.html index 36a489b..0c04b14 100644 --- a/test/karlcow/EOL-CR.html +++ b/test/karlcow/EOL-CR.html @@ -1 +1 @@ -

These lines all end with end of line (EOL) sequences.

Seriously, they really do.

If you don't believe me: HEX EDIT!

\ No newline at end of file +

These lines all end with end of line (EOL) sequences.

Seriously, they really do.

If you don't believe me: HEX EDIT!

\ No newline at end of file diff --git a/test/karlcow/EOL-LF.html b/test/karlcow/EOL-LF.html index c236b1d..49afea4 100644 --- a/test/karlcow/EOL-LF.html +++ b/test/karlcow/EOL-LF.html @@ -1,5 +1,3 @@

These lines all end with end of line (EOL) sequences.

-

Seriously, they really do.

-

If you don't believe me: HEX EDIT!

\ No newline at end of file diff --git a/test/karlcow/blockquote-added-markup.html b/test/karlcow/blockquote-added-markup.html index 375dbe8..d0b50bf 100644 --- a/test/karlcow/blockquote-added-markup.html +++ b/test/karlcow/blockquote-added-markup.html @@ -1,5 +1,4 @@

heading level 1

-

paragraph

diff --git a/test/karlcow/blockquote-line-2-paragraphs.html b/test/karlcow/blockquote-line-2-paragraphs.html index 9cb7059..081b88b 100644 --- a/test/karlcow/blockquote-line-2-paragraphs.html +++ b/test/karlcow/blockquote-line-2-paragraphs.html @@ -1,5 +1,4 @@

A blockquote with a very long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long line.

-

and a second very long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long line.

\ No newline at end of file diff --git a/test/karlcow/blockquote-multiline-2-paragraphs.html b/test/karlcow/blockquote-multiline-2-paragraphs.html index 1339eee..a0f1f2b 100644 --- a/test/karlcow/blockquote-multiline-2-paragraphs.html +++ b/test/karlcow/blockquote-multiline-2-paragraphs.html @@ -2,7 +2,6 @@

A blockquote on multiple lines like this.

-

But it has two paragraphs.

\ No newline at end of file diff --git a/test/karlcow/blockquote-nested-multiplereturn-level1.html b/test/karlcow/blockquote-nested-multiplereturn-level1.html index 37d039d..ff0a7e6 100644 --- a/test/karlcow/blockquote-nested-multiplereturn-level1.html +++ b/test/karlcow/blockquote-nested-multiplereturn-level1.html @@ -1,9 +1,7 @@

This is the first level of quoting.

-

This is nested blockquote.

-

Back to the first level.

\ No newline at end of file diff --git a/test/karlcow/blockquote-nested-multiplereturn.html b/test/karlcow/blockquote-nested-multiplereturn.html index 5b0d801..f3f11f9 100644 --- a/test/karlcow/blockquote-nested-multiplereturn.html +++ b/test/karlcow/blockquote-nested-multiplereturn.html @@ -1,6 +1,5 @@

This is the first level of quoting.

-

This is nested blockquote.

diff --git a/test/karlcow/blockquote-nested-return-level1.html b/test/karlcow/blockquote-nested-return-level1.html index d37d55f..42b8ab4 100644 --- a/test/karlcow/blockquote-nested-return-level1.html +++ b/test/karlcow/blockquote-nested-return-level1.html @@ -1,6 +1,5 @@

This is the first level of quoting.

-

This is nested blockquote. Back to the first level.

diff --git a/test/karlcow/blockquote-nested.html b/test/karlcow/blockquote-nested.html index 5b0d801..f3f11f9 100644 --- a/test/karlcow/blockquote-nested.html +++ b/test/karlcow/blockquote-nested.html @@ -1,6 +1,5 @@

This is the first level of quoting.

-

This is nested blockquote.

diff --git a/test/karlcow/header-level1-hash-sign-trailing-2-spaces.html b/test/karlcow/header-level1-hash-sign-trailing-2-spaces.html index 797d31c..013acb3 100644 --- a/test/karlcow/header-level1-hash-sign-trailing-2-spaces.html +++ b/test/karlcow/header-level1-hash-sign-trailing-2-spaces.html @@ -1,3 +1,2 @@

this is an h1 with two trailing spaces

-

A new paragraph.

\ No newline at end of file diff --git a/test/karlcow/list-blockquote.html b/test/karlcow/list-blockquote.html index 1d99d17..60b1770 100644 --- a/test/karlcow/list-blockquote.html +++ b/test/karlcow/list-blockquote.html @@ -1,6 +1,5 @@
  • a list containing a blockquote

    -

    this the blockquote in the list

  • diff --git a/test/karlcow/list-code.html b/test/karlcow/list-code.html index 33d36c9..664a61c 100644 --- a/test/karlcow/list-code.html +++ b/test/karlcow/list-code.html @@ -1,6 +1,5 @@
    • a list containing a block of code

      -
      10 PRINT HELLO INFINITE
       20 GOTO 10
       
    • diff --git a/test/karlcow/list-multiparagraphs-tab.html b/test/karlcow/list-multiparagraphs-tab.html index 40153a2..12467c9 100644 --- a/test/karlcow/list-multiparagraphs-tab.html +++ b/test/karlcow/list-multiparagraphs-tab.html @@ -2,7 +2,6 @@
    • This is a list item with two paragraphs. Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Aliquam hendrerit mi posuere lectus.

      -

      Vestibulum enim wisi, viverra nec, fringilla in, laoreet vitae, risus. Donec sit amet nisl. Aliquam semper ipsum sit amet velit.

    • diff --git a/test/karlcow/list-multiparagraphs.html b/test/karlcow/list-multiparagraphs.html index 40153a2..12467c9 100644 --- a/test/karlcow/list-multiparagraphs.html +++ b/test/karlcow/list-multiparagraphs.html @@ -2,7 +2,6 @@
    • This is a list item with two paragraphs. Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Aliquam hendrerit mi posuere lectus.

      -

      Vestibulum enim wisi, viverra nec, fringilla in, laoreet vitae, risus. Donec sit amet nisl. Aliquam semper ipsum sit amet velit.

    • diff --git a/test/karlcow/ordered-list-inner-par-list.html b/test/karlcow/ordered-list-inner-par-list.html index 1e5632a..4435e81 100644 --- a/test/karlcow/ordered-list-inner-par-list.html +++ b/test/karlcow/ordered-list-inner-par-list.html @@ -1,6 +1,5 @@
      1. 1

        -
        • inner par list