Просмотр исходного кода

add preProcessor and postProcessor.

Yuto Iwata 7 лет назад
Родитель
Сommit
8d788451ed
1 измененных файлов с 3 добавлено и 1 удалено
  1. 3 1
      src/client/js/util/reveal/plugins/growi-renderer.js

+ 3 - 1
src/client/js/util/reveal/plugins/growi-renderer.js

@@ -24,7 +24,7 @@
     let leadingTabs = text.match( /^\n?(\t*)/ )[1].length;
     let leadingTabs = text.match( /^\n?(\t*)/ )[1].length;
 
 
     if (leadingTabs > 0) {
     if (leadingTabs > 0) {
-      text = text.replace( new RegExp('\\n?\\t{' + leadingTabs + '}','g'), '\n' );
+      text = text.replace( new RegExp('\\n?\\t{' + leadingTabs + '}', 'g'), '\n' );
     }
     }
     else if (leadingWs > 1) {
     else if (leadingWs > 1) {
       text = text.replace( new RegExp('\\n? {' + leadingWs + '}', 'g'), '\n' );
       text = text.replace( new RegExp('\\n? {' + leadingWs + '}', 'g'), '\n' );
@@ -48,7 +48,9 @@
         section.setAttribute('data-markdown-parsed', 'true');
         section.setAttribute('data-markdown-parsed', 'true');
         markdown = getMarkdownFromSlide(section);
         markdown = getMarkdownFromSlide(section);
 
 
+        markdown = growiRenderer.preProcess(markdown);
         section.innerHTML = growiRenderer.process(markdown);
         section.innerHTML = growiRenderer.process(markdown);
+        section.innerHTML = growiRenderer.postProcess(section.innerHTML);
       }
       }
     }
     }
   }
   }