|
@@ -1,4 +1,4 @@
|
|
|
-;/*! showdown 02-06-2017 */
|
|
|
+;/*! showdown 07-06-2017 */
|
|
|
(function(){
|
|
|
/**
|
|
|
* Created by Tivie on 13-07-2015.
|
|
@@ -2460,16 +2460,14 @@ showdown.subParser('lists', function (text, options, globals) {
|
|
|
item = showdown.subParser('lists')(item, options, globals);
|
|
|
item = item.replace(/\n$/, ''); // chomp(item)
|
|
|
item = showdown.subParser('hashHTMLBlocks')(item, options, globals);
|
|
|
+
|
|
|
// Colapse double linebreaks
|
|
|
item = item.replace(/\n\n+/g, '\n\n');
|
|
|
- // replace double linebreaks with a placeholder
|
|
|
- item = item.replace(/\n\n/g, '¨B');
|
|
|
if (isParagraphed) {
|
|
|
item = showdown.subParser('paragraphs')(item, options, globals);
|
|
|
} else {
|
|
|
item = showdown.subParser('spanGamut')(item, options, globals);
|
|
|
}
|
|
|
- item = item.replace(/¨B/g, '\n\n');
|
|
|
}
|
|
|
|
|
|
// now we need to remove the marker (¨A)
|
|
@@ -2701,7 +2699,10 @@ showdown.subParser('spanGamut', function (text, options, globals) {
|
|
|
// Do hard breaks
|
|
|
if (options.simpleLineBreaks) {
|
|
|
// GFM style hard breaks
|
|
|
- text = text.replace(/\n/g, '<br />\n');
|
|
|
+ // only add line breaks if the text does not contain a block (special case for lists)
|
|
|
+ if (!/\n\n¨K/.test(text)) {
|
|
|
+ text = text.replace(/\n+/g, '<br />\n');
|
|
|
+ }
|
|
|
} else {
|
|
|
// Vanilla hard breaks
|
|
|
text = text.replace(/ +\n/g, '<br />\n');
|