|
|
@@ -5,6 +5,8 @@ export default class PlantUMLConfigurer {
|
|
|
constructor(crowi) {
|
|
|
this.crowi = crowi;
|
|
|
const config = crowi.getConfig();
|
|
|
+
|
|
|
+ this.deflate = require('markdown-it-plantuml/lib/deflate.js');
|
|
|
this.serverUrl = config.env.PLANTUML_URI || 'http://plantuml.com';
|
|
|
|
|
|
this.generateSource = this.generateSource.bind(this);
|
|
|
@@ -17,9 +19,8 @@ export default class PlantUMLConfigurer {
|
|
|
}
|
|
|
|
|
|
generateSource(umlCode) {
|
|
|
- var deflate = require('markdown-it-plantuml/lib/deflate.js');
|
|
|
- var zippedCode =
|
|
|
- deflate.encode64(deflate.zip_deflate('@startuml\n' + umlCode + '\n@enduml', 9));
|
|
|
+ const zippedCode =
|
|
|
+ this.deflate.encode64(this.deflate.zip_deflate('@startuml\n' + umlCode + '\n@enduml', 9));
|
|
|
return urljoin(this.serverUrl, 'plantuml', 'svg' , zippedCode);
|
|
|
}
|
|
|
}
|