elementProperties of Rangy doesn't work

223 views Asked by At

I'm using Rangy 1.3 TextRange in order to find text in a div and wrap it with a span. I want to add more attributes to the span by adding the option elementProperties but the attributes aren't added at all.

var applier = rangy.createCssClassApplier(
                 "result", 
                 { 
                    elementProperties: {
                     'data-value': 1
                    }
                 } 
              );

I'm using Rangy 1.3 and testing it on Chromium.

1

There are 1 answers

0
Tim Down On BEST ANSWER

elementProperties is for setting properties on elements rather than attributes. I have recently added elementAttributes as well (but not yet documented it), so you could use that instead for data attributes. The latest 1.3 release of Rangy has it.