1
0
mirror of https://github.com/Jermolene/TiddlyWiki5 synced 2024-11-27 03:57:21 +00:00

Dynannotate: Fix off-by-one error for end of annotation text

This commit is contained in:
jeremy@jermolene.com 2020-12-09 19:14:43 +00:00
parent 3016b3d094
commit 50d8325d4c

View File

@ -78,7 +78,7 @@ exports.TextMap.prototype.findText = function(targetString,targetPrefix,targetSu
if(startPos !== -1) { if(startPos !== -1) {
startPos += targetPrefix.length; startPos += targetPrefix.length;
var startMetadata = this.locateMetadata(startPos), var startMetadata = this.locateMetadata(startPos),
endMetadata = this.locateMetadata(startPos + targetString.length); endMetadata = this.locateMetadata(startPos + targetString.length - 1);
if(startMetadata && endMetadata) { if(startMetadata && endMetadata) {
return { return {
startNode: startMetadata.domNode, startNode: startMetadata.domNode,