Skip to content
Permalink
Browse files

fix: uml extension crash in viewer (close #229) (#249)

  • Loading branch information...
kyuwoo-choi committed Jul 4, 2018
1 parent 83bc877 commit 323fa468ff48058d123d74eb5c73c0ec0190586a
Showing with 8 additions and 1 deletion.
  1. +3 −1 src/js/viewer.js
  2. +5 −0 test/unit/viewer.spec.js
@@ -11,6 +11,7 @@ import CommandManager from './commandManager';
import extManager from './extManager';
import Convertor from './convertor';
import domUtils from './domUtils';
import {CodeBlockManager} from './codeBlockManager';
import codeBlockManager from './codeBlockManager';

const TASK_ATTR_NAME = 'data-te-task';
@@ -35,7 +36,8 @@ class ToastUIEditorViewer {
*/
constructor(options) {
this.options = $.extend({
useDefaultHTMLSanitizer: true
useDefaultHTMLSanitizer: true,
codeBlockLanguages: CodeBlockManager.getHighlightJSLanguages()
}, options);

this.eventManager = new EventManager();
@@ -37,4 +37,9 @@ describe('Viewer', () => {
const content = xssViewer.preview.getHTML();
expect(content).toBe(xss);
});

it('should have codeBlockLanugages option', () => {
const viewer = new ToastUIEditorViewer();
expect(viewer.options.codeBlockLanguages.length).toBeTruthy();
});
});

0 comments on commit 323fa46

Please sign in to comment.
You can’t perform that action at this time.