gpt4 book ai didi

html - 从 Quill 获取字体系列

转载 作者:行者123 更新时间:2023-12-05 03:04:14 25 4
gpt4 key购买 nike

我正在使用 Quill 构建富文本编辑器。它工作正常,我可以更改所选单词的字体,如此 example .

下一步是导出已编辑文本的原始 HTML。我期待标准 font-family要导出的样式,但我有 Quill 样式。

例如,使用上面的链接,如果我选择单词“hello”并将字体更改为 Mirza :

  • 输出的原始 HTML:<span class="ql-font-mirza">Hello </span>
  • 预期的原始 HTML:<span style="font-family: mirza;">Hello</span>

最佳答案

Quill guide 中对此进行了解释.

Example :

var FontStyle = Quill.import('attributors/style/font');
Quill.register(FontStyle, true);

var quill = new Quill('#editor-container', {
modules: {
toolbar: [
[{ header: [1, 2, false] }],
[{'font': []}],
['bold', 'italic', 'underline']
]
},
placeholder: 'Compose an epic...',
theme: 'snow' // or 'bubble'
});

关于html - 从 Quill 获取字体系列,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/53127051/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com