How to add data to insert/replace fragment
Posted: Wed Dec 14, 2022 3:09 am
Hello, I am trying to enclose certain text in fragment inside the Web author. For example if the text I want to wrap is "truthness" it would replace the word "truthness" in a tag like this -
I have been playing around with Insert and Replace fragment but I think it is only taking self enclosed tags as input for fragment parameter.
Here is the code I am using that almost works except it adds data inside the tag as "reference" (<reference>reference</reference> instead of <reference>truthness</reference>)
Code: Select all
<reference referenceGuid="someguid">truthness</reference>
Code: Select all
<reference />
Here is the code I am using that almost works except it adds data inside the tag as "reference" (<reference>reference</reference> instead of <reference>truthness</reference>)
Code: Select all
var data = '<reference />';
editorGlobal.getActionsManager().invokeOperation(
'ro.sync.ecss.extensions.commons.operations.InsertFragmentOperation',
{fragment: data},
function(e) {
console.log('Done!', e);
});