简体   繁体   English

所见即所得编辑器,支持编辑边距,填充和边框

[英]WYSIWYG Editor that support editing margin, padding and border

I am searching for long for an editor that let the user to change style attribute like border , padding , and margin 我正在寻找一个能让用户更改样式属性(例如borderpaddingmargin的编辑器,

I tested lot of editors, and didn't find. 我测试了许多编辑器,但没有找到。 Do you know about editor, that support it? 您知道有关编辑器的支持吗?

Editor I tested, and didn't have those buttons (maybe there are but I didn't see) 我测试过的编辑器,没有这些按钮(也许有,但是我没有看到)

  • ckEditor CKEDITOR
  • quill 鹅毛笔
  • pen 钢笔
  • medium.js medium.js
  • textAngular textAngular
  • and some others... 还有一些

https://github.com/Voog/wysihtml has functionality for changing style attributes on block and inline(or inline block) elements separately. https://github.com/Voog/wysihtml具有用于分别更改块和内联(或内联块)元素的样式属性的功能。

Look at tests for examples: Adding styles with formatInline command (applies on selected text when present) https://github.com/Voog/wysihtml/blob/master/test/commands/formatInline_test.js#L127 查看示例测试:使用formatInline命令添加样式(存在时应用于所选文本) https://github.com/Voog/wysihtml/blob/master/test/commands/formatInline_test.js#L127

formatBlock has similar syntax but is meant to insert/change block level elements. formatBlock具有相似的语法,但用于插入/更改块级元素。 (applies on closest block level element when present) (适用于存在时最接近的块级元素)

Unfortunately it does not have a functionality to change the style automatically picking inline or block method. 不幸的是,它没有更改样式的功能,可以自动选择内联或阻止方法。 The problem is that it is very difficult to know what elements user intended to pick with a selection. 问题在于,很难知道用户打算通过选择选择哪些元素。

Also currently editor does not guarantee minimal tag wrapping when using styles. 另外,当前编辑器在使用样式时不能保证最少的标签包装。 Additional <span> s or <div> s might be created depending on selection. 根据选择,可能会创建其他<span><div>

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM