Page 1 of 1

Surround with elements and copy text content

Posted: Mon Feb 20, 2017 8:13 pm
by Seb
Hi,

I'm wondering if this is somehow possible with Author Mode actions:

Selecting a text snippet "Hey" in Author mode, turning it into this:

Code: Select all

<a><b><d>Hey</d></b><c>Hey</c></a>
I tried to implement such a tagging mechanism with a combination of "ExecuteMultipleWebappCompatibleActionsOperation", "InsertFragmentOperation" and "ToggleSurroundWithElementOperation", but so far I've got no desired results.

Re: Surround with elements and copy text content

Posted: Tue Feb 21, 2017 10:21 am
by Radu
Hi,

From what I tested one way would be to use the predefined operation InsertOrReplaceFragmentOperation with the fragment to insert being:

Code: Select all

<a><b><d>${selection}</d></b><c>${selection}</c></a>
More about editor variables:

https://www.oxygenxml.com/doc/versions/ ... ables.html

Regards,
Radu

Re: Surround with elements and copy text content

Posted: Tue Feb 21, 2017 4:18 pm
by Seb
Hi Radu,

thank you! This is exactly what I was looking for.