Skip to content

Commit

Permalink
Merge pull request #180 from daliboris/feature/annotations/empty-elem…
Browse files Browse the repository at this point in the history
…ent-place

Allow placing the annotation element after the selected text
  • Loading branch information
wolfgangmm authored Oct 10, 2024
2 parents d58831d + 1ae820f commit a73a3dc
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/pb-view-annotate.js
Original file line number Diff line number Diff line change
Expand Up @@ -633,8 +633,8 @@ class PbViewAnnotate extends PbView {
const endRange = rangeToPoint(range.endContainer, range.endOffset, 'end');
const adjustedRange = {
context: startRange.parent,
start: startRange.offset,
end: info.before ? startRange.offset : endRange.offset,
start: (info.position === 'after') ? endRange.offset : startRange.offset,
end: (info === undefined || info.position === 'before') ? startRange.offset : endRange.offset,
text: info.before ? '' : range.cloneContents().textContent,
before: info.before
};
Expand Down

0 comments on commit a73a3dc

Please sign in to comment.