1
0
Fork 0
mirror of https://github.com/codex-team/codex.docs.git synced 2025-07-25 16:19:44 +02:00

Add warning tool, fix XSS in image alt-tag (#75)

* Add warning tool, fix XSS in image alt-tag

* production build

* Upgrade editor

* Add spaces
This commit is contained in:
Peter Savchenko 2019-03-20 10:07:59 +03:00 committed by GitHub
parent 93bf21fa2d
commit 42eacba15b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
12 changed files with 84 additions and 1045 deletions

View file

@ -2,6 +2,7 @@ import hljs from 'highlight.js/lib/highlight';
import javascript from 'highlight.js/lib/languages/javascript';
import xml from 'highlight.js/lib/languages/xml';
import json from 'highlight.js/lib/languages/json';
import css from 'highlight.js/lib/languages/css';
import style from 'highlight.js/styles/github-gist.css'; // eslint-disable-line no-unused-vars
/**
@ -13,13 +14,14 @@ export default class CodeStyler {
* @param {string} selector - CSS selector for code blocks
* @param {string[]} languages - list of languages to highlight, see hljs.listLanguages()
*/
constructor({ selector, languages = ['javascript', 'xml', 'json'] }) {
constructor({ selector, languages = ['javascript', 'xml', 'json', 'css'] }) {
this.codeBlocksSelector = selector;
this.languages = languages;
this.langsAvailable = {
javascript,
xml,
json
json,
css
};
this.init();

View file

@ -9,6 +9,7 @@ import CodeTool from '@editorjs/code';
import List from '@editorjs/list';
import Delimiter from '@editorjs/delimiter';
import Table from '@editorjs/table';
import Warning from '@editorjs/warning';
/**
* Inline Tools for the Editor
@ -74,6 +75,11 @@ export default class Editor {
inlineToolbar: true
},
warning: {
class: Warning,
inlineToolbar: ['inlineCode', 'italic', 'bold']
},
/**
* Inline Tools
*/