Explorar o código

Merge branch 'master' into develop

Estevao Soares dos Santos %!s(int64=8) %!d(string=hai) anos
pai
achega
d532dea8f0

+ 5 - 8
dist/showdown.js

@@ -1,4 +1,4 @@
-;/*! showdown 17-12-2016 */
+;/*! showdown 19-12-2016 */
 (function(){
 /**
  * Created by Tivie on 13-07-2015.
@@ -1258,9 +1258,9 @@ showdown.subParser('blockGamut', function (text, options, globals) {
 
   // Do Horizontal Rules:
   var key = showdown.subParser('hashBlock')('<hr />', options, globals);
-  text = text.replace(/^ {0,2}( ?\* ?){3,}[ \t]*$/gm, key);
-  text = text.replace(/^ {0,2}( ?- ?){3,}[ \t]*$/gm, key);
-  text = text.replace(/^ {0,2}( ?_ ?){3,}[ \t]*$/gm, key);
+  text = text.replace(/^( ?-){3,}[ \t]*$/gm, key);
+  text = text.replace(/^( ?\*){3,}[ \t]*$$/gm, key);
+  text = text.replace(/^( ?_){3,}[ \t]*$$/gm, key);
 
   text = showdown.subParser('lists')(text, options, globals);
   text = showdown.subParser('codeBlocks')(text, options, globals);
@@ -1951,7 +1951,6 @@ showdown.subParser('italicsAndBold', function (text, options, globals) {
  */
 showdown.subParser('lists', function (text, options, globals) {
   'use strict';
-
   text = globals.converter._dispatch('lists.before', text, options, globals);
   /**
    * Process the contents of a single ordered or unordered list, splitting it
@@ -2026,7 +2025,7 @@ showdown.subParser('lists', function (text, options, globals) {
       // <ul><li>- - a</li></ul>
       // So, to prevent it, we will put a marker (~A)in the beginning of the line
       // Kind of hackish/monkey patching, but seems more effective than overcomplicating the list parser
-      item = item.replace(/^([-*+]|\d\.)[ \t]+[\s\n]*/g, function (wm2) {
+      item = item.replace(/^([-*+]|\d\.)[ \t]+[\S\n ]*/g, function (wm2) {
         return '~A' + wm2;
       });
 
@@ -2049,7 +2048,6 @@ showdown.subParser('lists', function (text, options, globals) {
 
       // now we need to remove the marker (~A)
       item = item.replace('~A', '');
-
       // we can finally wrap the line in list item tags
       item =  '<li' + bulletStyle + '>' + item + '</li>\n';
       return item;
@@ -2128,7 +2126,6 @@ showdown.subParser('lists', function (text, options, globals) {
 
   // strip sentinel
   text = text.replace(/~0/, '');
-
   text = globals.converter._dispatch('lists.after', text, options, globals);
   return text;
 });

A diferenza do arquivo foi suprimida porque é demasiado grande
+ 0 - 0
dist/showdown.js.map


A diferenza do arquivo foi suprimida porque é demasiado grande
+ 1 - 1
dist/showdown.min.js


A diferenza do arquivo foi suprimida porque é demasiado grande
+ 0 - 0
dist/showdown.min.js.map


+ 3 - 3
src/subParsers/blockGamut.js

@@ -14,9 +14,9 @@ showdown.subParser('blockGamut', function (text, options, globals) {
 
   // Do Horizontal Rules:
   var key = showdown.subParser('hashBlock')('<hr />', options, globals);
-  text = text.replace(/^ {0,2}( ?\* ?){3,}[ \t]*$/gm, key);
-  text = text.replace(/^ {0,2}( ?- ?){3,}[ \t]*$/gm, key);
-  text = text.replace(/^ {0,2}( ?_ ?){3,}[ \t]*$/gm, key);
+  text = text.replace(/^( ?-){3,}[ \t]*$/gm, key);
+  text = text.replace(/^( ?\*){3,}[ \t]*$$/gm, key);
+  text = text.replace(/^( ?_){3,}[ \t]*$$/gm, key);
 
   text = showdown.subParser('lists')(text, options, globals);
   text = showdown.subParser('codeBlocks')(text, options, globals);

+ 1 - 4
src/subParsers/lists.js

@@ -3,7 +3,6 @@
  */
 showdown.subParser('lists', function (text, options, globals) {
   'use strict';
-
   text = globals.converter._dispatch('lists.before', text, options, globals);
   /**
    * Process the contents of a single ordered or unordered list, splitting it
@@ -78,7 +77,7 @@ showdown.subParser('lists', function (text, options, globals) {
       // <ul><li>- - a</li></ul>
       // So, to prevent it, we will put a marker (~A)in the beginning of the line
       // Kind of hackish/monkey patching, but seems more effective than overcomplicating the list parser
-      item = item.replace(/^([-*+]|\d\.)[ \t]+[\s\n]*/g, function (wm2) {
+      item = item.replace(/^([-*+]|\d\.)[ \t]+[\S\n ]*/g, function (wm2) {
         return '~A' + wm2;
       });
 
@@ -101,7 +100,6 @@ showdown.subParser('lists', function (text, options, globals) {
 
       // now we need to remove the marker (~A)
       item = item.replace('~A', '');
-
       // we can finally wrap the line in list item tags
       item =  '<li' + bulletStyle + '>' + item + '</li>\n';
       return item;
@@ -180,7 +178,6 @@ showdown.subParser('lists', function (text, options, globals) {
 
   // strip sentinel
   text = text.replace(/~0/, '');
-
   text = globals.converter._dispatch('lists.after', text, options, globals);
   return text;
 });

+ 3 - 0
test/issues/#312.spaced-dashes-followed-by-char4.html

@@ -0,0 +1,3 @@
+<ul>
+<li>- - - -- - - - - - - -- - - - - - - - - - -    - - - - - - - - -  abcd</li>
+</ul>

+ 1 - 0
test/issues/#312.spaced-dashes-followed-by-char4.md

@@ -0,0 +1 @@
+- - - - -- - - - - - - -- - - - - - - - - - -    - - - - - - - - -  abcd

Algúns arquivos non se mostraron porque demasiados arquivos cambiaron neste cambio