Преглед изворни кода

fix(nbsp): nbsp are replaced with simple spaces

Estevao Soares dos Santos пре 8 година
родитељ
комит
6e90f7c5ad
5 измењених фајлова са 6 додато и 0 уклоњено
  1. 3 0
      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 0
      src/converter.js

+ 3 - 0
dist/showdown.js

@@ -978,6 +978,9 @@ showdown.Converter = function (converterOptions) {
     text = text.replace(/\r\n/g, '\n'); // DOS to Unix
     text = text.replace(/\r\n/g, '\n'); // DOS to Unix
     text = text.replace(/\r/g, '\n'); // Mac to Unix
     text = text.replace(/\r/g, '\n'); // Mac to Unix
 
 
+    // Stardardize line spaces (nbsp causes trouble in older browsers and some regex flavors)
+    text = text.replace(/\u00A0/g, ' ');
+
     if (options.smartIndentationFix) {
     if (options.smartIndentationFix) {
       text = rTrimInputText(text);
       text = rTrimInputText(text);
     }
     }

Разлика између датотеке није приказан због своје велике величине
+ 0 - 0
dist/showdown.js.map


Разлика између датотеке није приказан због своје велике величине
+ 0 - 0
dist/showdown.min.js


Разлика између датотеке није приказан због своје велике величине
+ 0 - 0
dist/showdown.min.js.map


+ 3 - 0
src/converter.js

@@ -268,6 +268,9 @@ showdown.Converter = function (converterOptions) {
     text = text.replace(/\r\n/g, '\n'); // DOS to Unix
     text = text.replace(/\r\n/g, '\n'); // DOS to Unix
     text = text.replace(/\r/g, '\n'); // Mac to Unix
     text = text.replace(/\r/g, '\n'); // Mac to Unix
 
 
+    // Stardardize line spaces (nbsp causes trouble in older browsers and some regex flavors)
+    text = text.replace(/\u00A0/g, ' ');
+
     if (options.smartIndentationFix) {
     if (options.smartIndentationFix) {
       text = rTrimInputText(text);
       text = rTrimInputText(text);
     }
     }

Неке датотеке нису приказане због велике количине промена