rangy
rangy copied to clipboard
Cannot set dynamic values to ClassApplier properties
I tried to assign a variable and a function returning a string to the elementProperties and it doesn't work. When setting attempting to use a function it sets the function definition in string format o_O and setting a variable does nothing when its clearly got a value
highlighter.addClassApplier(
rangy.createClassApplier('note', {
ignoreWhiteSpace: true,
elementTagName: 'a',
elementProperties: {
href: '#',
title: noteText,
},
})
);
https://github.com/timdown/rangy/blob/1e55169d2e4d1d9458c2a87119addf47a8265276/src/modules/rangy-classapplier.js#L557
issue with this line. forces whatever is passed to turn into a string. Wouldn't it be better to just check if the value or whatever is passed is a string instead of doing this