Jump to content

Topic on Talk:VisualEditor/Gadgets/Add a tool

How can I enclose a selected text with a specific tag?

3
احمد نورالله (talkcontribs)

Hi, I have been trying to create a gadget that enclose the currently selected text with a "math" tag. Can anyone guide me to a tutorial (or doc) explains that?

احمد نورالله (talkcontribs)

I figured out how. That what I was looking for: ve.init.target.surface.getModel().getFragment().insertHtml() (if you are interested in).

Whatamidoing (WMF) (talkcontribs)
Reply to "How can I enclose a selected text with a specific tag?"