Ayr*_*rad 5 ruby-on-rails quill ruby-on-rails-5 parchment
尝试在羽毛笔中使用公式模块时出错.
错误是:
"[Parchment] Unable to create formula blot"
Run Code Online (Sandbox Code Playgroud)
在Chrome Web开发工具中出现错误消息后,将显示以下行 registry.ts
(webpack:///./~/parchment/src/registry.ts)
function create(input, value) {
var match = query(input);
if (match == null) {
throw new ParchmentError("Unable to create " + input + " blot");
}
var BlotClass = match;
var node = input instanceof Node ? input : BlotClass.create(value);
return new BlotClass(node, value);
}
Run Code Online (Sandbox Code Playgroud)
当我尝试插入公式时会发生这种情况.
当我使用quill-rails5
但不使用gem 时会发生这种情况.我删除了宝石以简化问题.这是我的代码:
var quill = new Quill('#editor', {
modules: {
formula: true,
toolbar: [
[{ header: [1, 2, false] }],
['bold', 'italic', 'underline'],
['image', 'code-block'],
['formula'],
]
},
placeholder: 'Compose a solution...',
theme: 'snow' // or 'bubble'
});
Run Code Online (Sandbox Code Playgroud)
我的编辑容器
<div id="editor">
<%= raw sanitize @post.description, tags: %w(strong em div a p br ul ol li), attributes: %w(href) %>
</div>
Run Code Online (Sandbox Code Playgroud)
小智 2
您是否按照文档中的说明包含了 katex.js 和 katex.css ?
一个工作示例:
<!-- Include KaTeX stylesheet -->
<link href="katex.css" rel="stylesheet">
<!-- Include KaTeX library -->
<script href="katex.js" type="text/javascript"></script>
<script type="text/javascript">
var quill = new Quill('#editor', {
modules: {
formula: true, // Include formula module
toolbar: [['formula']] // Include button in toolbar
},
theme: 'snow'
});
</script>
Run Code Online (Sandbox Code Playgroud)
归档时间: |
|
查看次数: |
303 次 |
最近记录: |