You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
What steps will reproduce the problem? rangy.init();
highlighter = rangy.createHighlighter(document, "TextRange");
highlighter.addClassApplier(rangy.createCssClassApplier("selected-highlighted", {
ignoreWhiteSpace: true,
}));
highlighter.deserialize("type:TextRange|5296$5387$2$some-other-highlighter$"); What is the expected output? What do you see instead? I expect it to use 'selected-highlighted' as the highlighters, or if that's not possible, it should throw an error since 'rangy-highlighter.js' "classApplier = this.classAppliers[parts[3]];" will be undefined. What version of the product are you using? On what operating system? 1.3r751 Please provide any additional information below. I'm on Chrome 30.
I proposed adding the following code below "classApplier = this.classAppliers[parts[3]];" in deserialize() function:
// If parts[3] highlighter doesn't exist, use whatever is in this.classAppliers
if (typeof classAppliers == 'undefined') {
// Get first object and assign classApplier with it
for(var first_key in this.classAppliers) break;
classApplier = this.classAppliers[first_key];
console.log("Using another classApplier since " + parts[3] + " wasn't added. Using " + first_key + " instead.");
From heng...@notable.ac on October 24, 2013 15:30:37
What steps will reproduce the problem? rangy.init();
highlighter = rangy.createHighlighter(document, "TextRange");
highlighter.addClassApplier(rangy.createCssClassApplier("selected-highlighted", {
ignoreWhiteSpace: true,
}));
highlighter.deserialize("type:TextRange|5296$5387$2$some-other-highlighter$"); What is the expected output? What do you see instead? I expect it to use 'selected-highlighted' as the highlighters, or if that's not possible, it should throw an error since 'rangy-highlighter.js' "classApplier = this.classAppliers[parts[3]];" will be undefined. What version of the product are you using? On what operating system? 1.3r751 Please provide any additional information below. I'm on Chrome 30.
Original issue: http://code.google.com/p/rangy/issues/detail?id=186
The text was updated successfully, but these errors were encountered: