Skip to content

Commit

Permalink
Merge pull request #35 from inception-project/feature/34-Ability-to-w…
Browse files Browse the repository at this point in the history
…ork-only-with-TextPositionSelector-and-without-TextQuoteSelector

#34 - Ability to work only with TextPositionSelector and without TextQuoteSelector
  • Loading branch information
rsimon authored Jun 27, 2021
2 parents f4e54a4 + 3707d6a commit b35284f
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/highlighter/Highlighter.js
Original file line number Diff line number Diff line change
Expand Up @@ -289,13 +289,13 @@ export default class Highlighter {
getAnnotationsRecursive(parent, annotations) : annotations;
},

sortByQuoteLength = function(annotations) {
sortByRangeLength = function(annotations) {
return annotations.sort(function(a, b) {
return a.quote.length - b.quote.length;
return (a.end - a.start) - (b.end - b.start);
});
};

return sortByQuoteLength(getAnnotationsRecursive(element));
return sortByRangeLength(getAnnotationsRecursive(element));
}

}

0 comments on commit b35284f

Please sign in to comment.