소스 검색

fix(strikethrough): fix striketrough being wrongly parsed inside codeSpans

Estevao Soares dos Santos 8 년 전
부모
커밋
169cbe8e2d
7개의 변경된 파일11개의 추가작업 그리고 2개의 파일을 삭제
  1. 1 1
      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. 1 1
      src/subParsers/encodeCode.js
  6. 3 0
      test/features/#164.3.strikethrough.html
  7. 6 0
      test/features/#164.3.strikethrough.md

+ 1 - 1
dist/showdown.js

@@ -1678,7 +1678,7 @@ showdown.subParser('encodeCode', function (text, options, globals) {
     .replace(/</g, '&lt;')
     .replace(/>/g, '&gt;')
   // Now, escape characters that are magic in Markdown:
-    .replace(/([*_{}\[\]\\=-])/g, showdown.helper.escapeCharactersCallback);
+    .replace(/([*_{}\[\]\\=~-])/g, showdown.helper.escapeCharactersCallback);
 
   text = globals.converter._dispatch('encodeCode.after', text, options, globals);
   return text;

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


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


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


+ 1 - 1
src/subParsers/encodeCode.js

@@ -16,7 +16,7 @@ showdown.subParser('encodeCode', function (text, options, globals) {
     .replace(/</g, '&lt;')
     .replace(/>/g, '&gt;')
   // Now, escape characters that are magic in Markdown:
-    .replace(/([*_{}\[\]\\=-])/g, showdown.helper.escapeCharactersCallback);
+    .replace(/([*_{}\[\]\\=~-])/g, showdown.helper.escapeCharactersCallback);
 
   text = globals.converter._dispatch('encodeCode.after', text, options, globals);
   return text;

+ 3 - 0
test/features/#164.3.strikethrough.html

@@ -1,3 +1,6 @@
 <p>a <del>strikethrough</del> word</p>
 <p>this should~~not be parsed</p>
 <p><del>strike-through text</del></p>
+<p><code>~~strikethough inside code span~~</code></p>
+<p>escaped ~~strikethrough~~</p>
+<p>escaped ~~strikethrough~~</p>

+ 6 - 0
test/features/#164.3.strikethrough.md

@@ -3,3 +3,9 @@ a ~~strikethrough~~ word
 this should~~not be parsed
 
 ~~strike-through text~~
+
+`~~strikethough inside code span~~`
+
+escaped \~~strikethrough~~
+
+escaped \~~strikethrough\~~

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