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:
parent
93bf21fa2d
commit
42eacba15b
12 changed files with 84 additions and 1045 deletions
|
@ -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();
|
||||
|
|
|
@ -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
|
||||
*/
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue