多应用+插件架构,代码干净,二开方便,首家独创一键云编译技术,文档视频完善,免费商用码云13.8K 广告
[TOC] <!-- The Syntax Module enhances the Code Block format by automatically detecting and applying syntax highlighting. The excellent [highlight.js](https://highlightjs.org/) library is used as a dependency to parse and tokenize code blocks. In general, you may [configure](https://highlightjs.readthedocs.io/en/latest/api.html#configure-options) highlight.js as needed. However, Quill expects and requires the `useBR` option to be `false`. --> 语法模块通过自动检测和应用语法高亮来增强代码块的格式。优秀库<a href="https://highlightjs.org/">highlight.js</a>被用作依赖库来解析和标记代码块。 一般的,你可能需要<a href="https://highlightjs.readthedocs.io/en/latest/api.html#configure-options">configure</a> highlight.js。但,在Quill中预计要求设置`useBR`选项为`false`。 ## Example ```html <!-- Include your favorite highlight.js stylesheet --> <link href="highlight.js/monokai-sublime.min.css" rel="stylesheet"> <!-- Include the highlight.js library --> <script href="highlight.js"></script> <script> hljs.configure({ // optionally configure hljs languages: ['javascript', 'ruby', 'python'] }); var quill = new Quill('#editor', { modules: { syntax: true, // Include syntax module toolbar: [['code-block']] // Include button in toolbar }, theme: 'snow' }); </script> ```