|
@@ -3,8 +3,7 @@ import MarkdownIt from 'markdown-it';
|
|
|
import Linker from './PreProcessor/Linker';
|
|
import Linker from './PreProcessor/Linker';
|
|
|
import CsvToTable from './PreProcessor/CsvToTable';
|
|
import CsvToTable from './PreProcessor/CsvToTable';
|
|
|
import XssFilter from './PreProcessor/XssFilter';
|
|
import XssFilter from './PreProcessor/XssFilter';
|
|
|
-
|
|
|
|
|
-import Template from './LangProcessor/Template';
|
|
|
|
|
|
|
+import CrowiTemplate from './PostProcessor/CrowiTemplate';
|
|
|
|
|
|
|
|
import CommonPluginsConfigurer from './markdown-it/common-plugins';
|
|
import CommonPluginsConfigurer from './markdown-it/common-plugins';
|
|
|
import EmojiConfigurer from './markdown-it/emoji';
|
|
import EmojiConfigurer from './markdown-it/emoji';
|
|
@@ -38,12 +37,9 @@ export default class GrowiRenderer {
|
|
|
new XssFilter(crowi),
|
|
new XssFilter(crowi),
|
|
|
];
|
|
];
|
|
|
this.postProcessors = this.originRenderer.postProcessors || [
|
|
this.postProcessors = this.originRenderer.postProcessors || [
|
|
|
|
|
+ new CrowiTemplate(crowi),
|
|
|
];
|
|
];
|
|
|
|
|
|
|
|
- this.langProcessors = this.originRenderer.langProcessors || {
|
|
|
|
|
- 'template': new Template(crowi),
|
|
|
|
|
- };
|
|
|
|
|
-
|
|
|
|
|
this.initMarkdownItConfigurers = this.initMarkdownItConfigurers.bind(this);
|
|
this.initMarkdownItConfigurers = this.initMarkdownItConfigurers.bind(this);
|
|
|
this.setup = this.setup.bind(this);
|
|
this.setup = this.setup.bind(this);
|
|
|
this.process = this.process.bind(this);
|
|
this.process = this.process.bind(this);
|
|
@@ -147,11 +143,6 @@ export default class GrowiRenderer {
|
|
|
const lang = langAndFn[0];
|
|
const lang = langAndFn[0];
|
|
|
const langFn = langAndFn[1] || null;
|
|
const langFn = langAndFn[1] || null;
|
|
|
|
|
|
|
|
- // process langProcessors
|
|
|
|
|
- if (this.langProcessors[lang] != null) {
|
|
|
|
|
- return this.langProcessors[lang].process(code, langExt);
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
const citeTag = (langFn) ? `<cite>${langFn}</cite>` : '';
|
|
const citeTag = (langFn) ? `<cite>${langFn}</cite>` : '';
|
|
|
if (hljs.getLanguage(lang)) {
|
|
if (hljs.getLanguage(lang)) {
|
|
|
try {
|
|
try {
|