refactor: remove HTML report export and implement PDF export options in PDF comparison tool
- Deleted the exportCompareHtmlReport function and its related imports. - Introduced a dropdown menu for exporting comparison results as PDFs with multiple modes (split, alternating, left, right). - Updated the comparison logic to utilize caching for page models and comparison results. - Refactored rendering functions to improve code organization and maintainability. - Enhanced UI elements for better user experience during PDF export.
This commit is contained in:
@@ -1,8 +1,5 @@
|
||||
import type { ComparePagePair, ComparePageSignature } from '../types.ts';
|
||||
|
||||
function tokenize(text: string) {
|
||||
return new Set(text.split(/\s+/).filter(Boolean));
|
||||
}
|
||||
import { tokenizeTextAsSet } from './text-normalization.ts';
|
||||
|
||||
function similarityScore(
|
||||
left: ComparePageSignature,
|
||||
@@ -16,8 +13,8 @@ function similarityScore(
|
||||
return 0.08;
|
||||
}
|
||||
|
||||
const leftTokens = tokenize(left.plainText);
|
||||
const rightTokens = tokenize(right.plainText);
|
||||
const leftTokens = tokenizeTextAsSet(left.plainText);
|
||||
const rightTokens = tokenizeTextAsSet(right.plainText);
|
||||
const union = new Set([...leftTokens, ...rightTokens]);
|
||||
let intersectionCount = 0;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user