diff --git a/apple/OmnivoreKit/Sources/App/Views/WebReader/HighlightViewer.swift b/apple/OmnivoreKit/Sources/App/Views/WebReader/HighlightViewer.swift new file mode 100644 index 000000000..a361a99b2 --- /dev/null +++ b/apple/OmnivoreKit/Sources/App/Views/WebReader/HighlightViewer.swift @@ -0,0 +1,8 @@ +// +// File.swift +// +// +// Created by Jackson Harper on 11/21/22. +// + +import Foundation diff --git a/packages/api/src/utils/highlightGenerator.ts b/packages/api/src/utils/highlightGenerator.ts index 2b472f8b6..52aa86a4c 100644 --- a/packages/api/src/utils/highlightGenerator.ts +++ b/packages/api/src/utils/highlightGenerator.ts @@ -94,9 +94,9 @@ function getTextNodesBetween(rootNode: Node, startNode: Node, endNode: Node) { } } -export function findEmbeddedHighlight( +export const findEmbeddedHighlight = ( dom: Element -): EmbeddedHighlightData | undefined { +): EmbeddedHighlightData | undefined => { const startNode = dom.querySelector( 'span[data-omnivore-highlight-start="true"]' ) @@ -158,7 +158,6 @@ function generateDiffPatch( afterNodes: ArticleTextContent ): string { const textWithTags = `${beforeNodes.articleText}<${highlightTag}>${highlightNodes.articleText}${afterNodes.articleText}` - const diffMatchPatch = new DiffMatchPatch() const patch = diffMatchPatch.patch_toText( diffMatchPatch.patch_make(allArticleNodes.articleText, textWithTags)