ThinkChat2.0新版上线,更智能更精彩,支持会话、画图、阅读、搜索等,送10W Token,即刻开启你的AI之旅 广告
[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> ```