当在编辑器中选中一个文本范围时,我们希望提供一个可用于包装这段文本的样式标签集合。
When a text range is selected in the editor, we want to offer a collection of style tags with which this text can be wrapped.
清单20中所示的方法可以进一步修改,以使这些选中的节点能在一个启用了的节点被选中后单击某个被禁用的节点时仍保持其样式,如清单21所示。
The method shown in Listing 20 can further be modified as shown in Listing 21, so that the selected nodes keep their style when clicking on a disabled node after an enabled node was already selected.
如果选中了文本范围,则检索选中的文本,并计算出样式标签建议,如清单4所示。
If a text range was selected, retrieve the selected text and compute the proposals for style tags, as shown in Listing 4.
应用推荐