소스 검색

fix(horizontal rule): revert backwards incompatibility change

Horizontal rule syntax allows up to 3 spaces preceding dashes or
asterisks. Commit da8fb53 wrongfully removed that. This commit
puts that back.

Closes #317
Estevao Soares dos Santos 8 년 전
부모
커밋
113f5f64b1
7개의 변경된 파일11개의 추가작업 그리고 6개의 파일을 삭제
  1. 3 3
      dist/showdown.js
  2. 0 0
      dist/showdown.js.map
  3. 0 0
      dist/showdown.min.js
  4. 0 0
      dist/showdown.min.js.map
  5. 3 3
      src/subParsers/blockGamut.js
  6. 2 0
      test/issues/#317.spaces-before-hr.html
  7. 3 0
      test/issues/#317.spaces-before-hr.md

+ 3 - 3
dist/showdown.js

@@ -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(/^( ?-){3,}[ \t]*$/gm, key);
-  text = text.replace(/^( ?\*){3,}[ \t]*$/gm, key);
-  text = text.replace(/^( ?_){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(/^ {0,2}( ?_){3,}[ \t]*$/gm, key);
 
   text = showdown.subParser('lists')(text, options, globals);
   text = showdown.subParser('codeBlocks')(text, options, globals);

파일 크기가 너무 크기때문에 변경 상태를 표시하지 않습니다.
+ 0 - 0
dist/showdown.js.map


파일 크기가 너무 크기때문에 변경 상태를 표시하지 않습니다.
+ 0 - 0
dist/showdown.min.js


파일 크기가 너무 크기때문에 변경 상태를 표시하지 않습니다.
+ 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(/^( ?-){3,}[ \t]*$/gm, key);
-  text = text.replace(/^( ?\*){3,}[ \t]*$/gm, key);
-  text = text.replace(/^( ?_){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(/^ {0,2}( ?_){3,}[ \t]*$/gm, key);
 
   text = showdown.subParser('lists')(text, options, globals);
   text = showdown.subParser('codeBlocks')(text, options, globals);

+ 2 - 0
test/issues/#317.spaces-before-hr.html

@@ -0,0 +1,2 @@
+<hr />
+<hr />

+ 3 - 0
test/issues/#317.spaces-before-hr.md

@@ -0,0 +1,3 @@
+   ---
+
+   - - -

이 변경점에서 너무 많은 파일들이 변경되어 몇몇 파일들은 표시되지 않았습니다.