@adobe/spacecat-shared-html-analyzer 1.2.0 → 1.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +7 -0
- package/package.json +1 -1
- package/src/index.d.ts +47 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,10 @@
|
|
|
1
|
+
# [@adobe/spacecat-shared-html-analyzer-v1.2.1](https://github.com/adobe/spacecat-shared/compare/@adobe/spacecat-shared-html-analyzer-v1.2.0...@adobe/spacecat-shared-html-analyzer-v1.2.1) (2026-01-15)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Bug Fixes
|
|
5
|
+
|
|
6
|
+
* html-analyser pkg adding exported methods in typescript file ([#1265](https://github.com/adobe/spacecat-shared/issues/1265)) ([10d173b](https://github.com/adobe/spacecat-shared/commit/10d173b68c3c4158a49465a3f3d7a78b68dccc3b))
|
|
7
|
+
|
|
1
8
|
# [@adobe/spacecat-shared-html-analyzer-v1.2.0](https://github.com/adobe/spacecat-shared/compare/@adobe/spacecat-shared-html-analyzer-v1.1.0...@adobe/spacecat-shared-html-analyzer-v1.2.0) (2025-12-04)
|
|
2
9
|
|
|
3
10
|
|
package/package.json
CHANGED
package/src/index.d.ts
CHANGED
|
@@ -174,3 +174,50 @@ export function calculateBothScenarioStats(
|
|
|
174
174
|
currentHTML: string
|
|
175
175
|
): Promise<BothScenariosStats>;
|
|
176
176
|
|
|
177
|
+
/** MARKDOWN DIFF FUNCTIONS */
|
|
178
|
+
interface MarkdownDiffBlock {
|
|
179
|
+
html: string;
|
|
180
|
+
text: string;
|
|
181
|
+
tagName: string;
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
interface MarkdownDiffOperation {
|
|
185
|
+
type: "same" | "add" | "del";
|
|
186
|
+
originalBlock?: MarkdownDiffBlock;
|
|
187
|
+
currentBlock?: MarkdownDiffBlock;
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
/**
|
|
191
|
+
* Diff DOM blocks using LCS algorithm
|
|
192
|
+
*/
|
|
193
|
+
export function diffDOMBlocks(
|
|
194
|
+
originalBlocks: MarkdownDiffBlock[],
|
|
195
|
+
currentBlocks: MarkdownDiffBlock[]
|
|
196
|
+
): MarkdownDiffOperation[];
|
|
197
|
+
|
|
198
|
+
/**
|
|
199
|
+
* Create markdown table diff from parsed DOM children
|
|
200
|
+
*/
|
|
201
|
+
export function createMarkdownTableDiff(
|
|
202
|
+
originalChildren: Element[],
|
|
203
|
+
currentChildren: Element[],
|
|
204
|
+
$?: unknown
|
|
205
|
+
): { tableHtml: string; counters: string };
|
|
206
|
+
|
|
207
|
+
/**
|
|
208
|
+
* Convert HTML to rendered markdown HTML (for display)
|
|
209
|
+
*/
|
|
210
|
+
export function htmlToRenderedMarkdown(
|
|
211
|
+
html: string,
|
|
212
|
+
ignoreNavFooter?: boolean
|
|
213
|
+
): Promise<string>;
|
|
214
|
+
|
|
215
|
+
/**
|
|
216
|
+
* Generate complete markdown diff with HTML to Markdown conversion
|
|
217
|
+
*/
|
|
218
|
+
export function generateMarkdownDiff(
|
|
219
|
+
originalHtml: string,
|
|
220
|
+
currentHtml: string,
|
|
221
|
+
ignoreNavFooter?: boolean
|
|
222
|
+
): Promise<{ originalRenderedHtml: string; currentRenderedHtml: string }>;
|
|
223
|
+
|