ckeditor5-image-upload-base64
Version:
The development environment of CKEditor 5 – the best browser-based rich text editor.
38 lines (32 loc) • 637 B
JavaScript
/**
* @license Copyright (c) 2003-2019, CKSource - Frederico Knabben. All rights reserved.
* For licensing, see LICENSE.md.
*/
/**
* @module markdown-gfm/markdown2html
*/
import marked from 'marked';
// Overrides.
marked.use( {
tokenizer: {
// Disable the autolink rule in the lexer.
autolink: () => null,
url: () => null
}
} );
/**
* Parses markdown string to an HTML.
*
* @param {String} markdown
* @returns {String}
*/
export default function markdown2html( markdown ) {
return marked.parse( markdown, {
gfm: true,
breaks: true,
tables: true,
xhtml: true,
headerIds: false
} );
}
export { marked };