Skip to content

Commit

Permalink
Ignore Zotero exported FreeText annotations
Browse files Browse the repository at this point in the history
  • Loading branch information
mrtcode committed Jan 26, 2024
1 parent 10691ef commit 130200b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/core/document.js
Original file line number Diff line number Diff line change
Expand Up @@ -465,7 +465,6 @@ class Page {
const allowedSubtypes = [
'Link',
'Widget',
'FreeText',
'Line',
'Circle',
'PolyLine',
Expand All @@ -475,8 +474,9 @@ class Page {
'StrikeOut',
'Stamp'
];

annotations = annotations.filter(x => allowedSubtypes.includes(x.data.subtype)
|| ['Square', 'Ink'].includes(x.data.subtype) && !x.data.isZotero);
|| ['Square', 'Ink', 'FreeText'].includes(x.data.subtype) && !x.data.isZotero);

// Collect the operator list promises for the annotations. Each promise
// is resolved with the complete operator list for a single annotation.
Expand Down
3 changes: 1 addition & 2 deletions web/annotation_layer_builder.js
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,6 @@ class AnnotationLayerBuilder {
const allowedSubtypes = [
'Link',
'Widget',
'FreeText',
'Line',
'Circle',
'PolyLine',
Expand All @@ -128,7 +127,7 @@ class AnnotationLayerBuilder {
'Stamp'
];
annotations = annotations.filter(x => allowedSubtypes.includes(x.subtype)
|| ['Square', 'Ink'].includes(x.subtype) && !x.isZotero);
|| ['Square', 'Ink', 'FreeText'].includes(x.subtype) && !x.isZotero);

// Create an annotation layer div and render the annotations
// if there is at least one annotation.
Expand Down

0 comments on commit 130200b

Please sign in to comment.