Reputation: 3395
I am trying to create a class applier that would wrap the selection in the following element:
<code class="mainClass selector1 selector2">Selected Content</code>
I am doing the following:
var Applier = rangy.createClassApplier("mainClass",
{
elementTagName: "code",
elementProperties:
{
className: [ "selector1", "selector2" ]
}
});
Applier.toggleSelection();
This yields the following:
<code class="mainClass selector1,selector2">Selected Content</code>
What is the syntax to create the applier so that it does what I am trying to do?
Upvotes: 5
Views: 888