我可以将 "a)" 之类的列表样式类型添加到 ckeditor 吗?
Can I add list style type like "a)" to ckeditor?
有没有办法提供像这样的列表样式:
a)
b)
c)
在 ckeditor 的第 4 版中?
是的,你可以这样做:
CKEDITOR.instances.{{yourinstance}}.inserthtml('htmlcode')
要插入 html,您需要在 ckeditor.instanceready 上执行此操作,您只需发送您想要的 html 代码。
CKEDITOR.instances.editor1.insertHtml('<ol type="A"><li>itema</li><li>itemb</li><li>itemc</li></ol>')
有了这个,如果你想在按钮中使用它,你可以创建一个插件
注意:我的示例输出 A.item 如果你真的需要 a) item you need to do it on html and css
在 中解释说您可以使用 CSS 来创建带有 a) b) c)
等的列表类型。所以现在您只需要重建输出和 css在 ck 编辑器中。
ol {
counter-reset: list;
}
ol > li {
list-style: none;
}
ol > li:before {
content: counter(list, lower-alpha) ") ";
counter-increment: list;
}
在我们的例子中,我们使用额外的 "trick" 来到达那里。只需将 ol[style="list-style-type:lower-alpha"]
替换为上面的 ol
即可。
有没有办法提供像这样的列表样式:
a)
b)
c)
在 ckeditor 的第 4 版中?
是的,你可以这样做:
CKEDITOR.instances.{{yourinstance}}.inserthtml('htmlcode')
要插入 html,您需要在 ckeditor.instanceready 上执行此操作,您只需发送您想要的 html 代码。
CKEDITOR.instances.editor1.insertHtml('<ol type="A"><li>itema</li><li>itemb</li><li>itemc</li></ol>')
有了这个,如果你想在按钮中使用它,你可以创建一个插件
注意:我的示例输出 A.item 如果你真的需要 a) item you need to do it on html and css
在 中解释说您可以使用 CSS 来创建带有 a) b) c)
等的列表类型。所以现在您只需要重建输出和 css在 ck 编辑器中。
ol {
counter-reset: list;
}
ol > li {
list-style: none;
}
ol > li:before {
content: counter(list, lower-alpha) ") ";
counter-increment: list;
}
在我们的例子中,我们使用额外的 "trick" 来到达那里。只需将 ol[style="list-style-type:lower-alpha"]
替换为上面的 ol
即可。