diff --git a/.gitignore b/.gitignore
index f49a970..da04330 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,3 +1,4 @@
.DS_Store
node_modules
-release-builds
\ No newline at end of file
+release-builds
+test-files/files-3/*.plist
\ No newline at end of file
diff --git a/js/renderer.js b/js/renderer.js
index 0fa4b8d..31d52a1 100644
--- a/js/renderer.js
+++ b/js/renderer.js
@@ -201,7 +201,7 @@ async function populate(button) {
listOfBooks[bookHash]['annotations'].forEach(annotation => {
let annotationElement = `
`;
- if (annotation['representativeText'] !== null) {
+ if (annotation['representativeText'] !== null && annotation['representativeText'].includes(annotation['selectedText'])) {
annotationElement += annotation['representativeText'].replace(
annotation['selectedText'],
`${annotation['selectedText']}`
diff --git a/test-files/files-2/com.apple.ibooks-sync.plist b/test-files/files-2/com.apple.ibooks-sync.plist
index 89e7d26..957ec78 100644
--- a/test-files/files-2/com.apple.ibooks-sync.plist
+++ b/test-files/files-2/com.apple.ibooks-sync.plist
@@ -62,6 +62,65 @@
AQEAAAAAAAAAIgAAAAAAAAAAAAAAAAAAAOA=
+
+ annotationAssetID
+ CED2211604373C3FCF42A347F1E97E2E
+ annotationCreationDate
+ 1606856246
+ annotationCreatorIdentifier
+ com~apple~iBooks
+ annotationDeleted
+ 0
+ annotationIsUnderline
+ 0
+ annotationLocation
+ epubcfi(/6/10[My-Enemy-s-Enemy-3]!/4[My-Enemy-s-Enemy-3]/2,/4/1:0,/6/2/1:29)
+ annotationModificationDate
+ 1606856248
+ annotationRepresentativeText
+ “Four things greater than all things are,—Women and Horses and Power and War.”
+ annotationSelectedText
+ “Four things greater than all things are,—Women and Horses and Power and War.”
+—Rudyard Kipling, The Ballad of the King’s Test
+ annotationStyle
+ 1
+ annotationType
+ 2
+ annotationUuid
+ 22DB2C35-1202-48A3-BEFF-A774EE41ADC2
+ futureProofing11
+ 628549046.238739
+ futureProofing5
+ Epigraph
+ futureProofing6
+ 628549048.159193
+ futureProofing7
+ {0, 126}
+ futureProofing9
+ 1
+ plAbsolutePhysicalLocation
+ 0
+ plLocationRangeEnd
+ 0
+ plLocationRangeStart
+ 4
+ plUserData
+
+ YnBsaXN0MDDWAQIDBAUGBwgMDR4fVWNsYXNzVXN1cGVy
+ W3N0YXJ0T2Zmc2V0V2VuZFBhdGhZZW5kT2Zmc2V0WXN0
+ YXJ0UGF0aF5CS0VwdWJMb2NhdGlvbtIJAQoLV29yZGlu
+ YWwQBFpCS0xvY2F0aW9uIgAAAACkDhUZHNMPEBESExRX
+ dGFnTmFtZVljbGFzc05hbWVVaW5kZXhTZGl2XxAbX2lk
+ R2VuT2JqZWN0U3R5bGVPdmVycmlkZS0xEALTDxARFhcY
+ UXBfEBhNYWluLUJvZHkgUGFyYU92ZXJyaWRlLTUQBtMP
+ EBEaGxRUc3BhblFJ0REdEAEiQegAAKMgIiTTDxAREiEU
+ XxAbX2lkR2VuT2JqZWN0U3R5bGVPdmVycmlkZS0x0w8Q
+ ERYjCllNYWluLUJvZHnRER0ACAAVABsAIQAtADUAPwBJ
+ AFgAXQBlAGcAcgB3AHwAgwCLAJUAmwCfAL0AvwDGAMgA
+ 4wDlAOwA8QDzAPYA+AD9AQEBCAEmAS0BNwAAAAAAAAIB
+ AAAAAAAAACUAAAAAAAAAAAAAAAAAAAE6
+
+
Generation
1699730376
diff --git a/test-files/files-2/expected.png b/test-files/files-2/expected.png
index 9b1276e..bfdc19d 100644
Binary files a/test-files/files-2/expected.png and b/test-files/files-2/expected.png differ