From d48bb76a9efce6b8e6546b74b538ba7d916c819a Mon Sep 17 00:00:00 2001 From: didimmova Date: Wed, 17 Apr 2024 10:02:11 +0300 Subject: [PATCH 1/2] refactor(template): refactor filtering logic --- src/app/services/rendering/toc.ts | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/app/services/rendering/toc.ts b/src/app/services/rendering/toc.ts index a48194e..b3841df 100644 --- a/src/app/services/rendering/toc.ts +++ b/src/app/services/rendering/toc.ts @@ -191,8 +191,6 @@ export class TocRenderingService extends RenderingService implements ResizableOb let parent = $(anchor).parent() as unknown as JQuery; let parentNodes: JQuery[] = parent.parents("ul>li") as unknown as JQuery[]; let latest = parentNodes.length > 0 ? parentNodes[parentNodes.length - 1] : parent; - let header = $(latest).prevAll("li[data-is-header='true']").first(); - parentNodes.push(header); for (let i = 0; i < parentNodes.length; i++) { let parentText; let parentNode = $(parentNodes[i]); From a07b2dfffb6248d472578b2b4094889d4241e130 Mon Sep 17 00:00:00 2001 From: didimmova Date: Wed, 17 Apr 2024 10:26:47 +0300 Subject: [PATCH 2/2] refactor(template): remove unused variable --- src/app/services/rendering/toc.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/src/app/services/rendering/toc.ts b/src/app/services/rendering/toc.ts index b3841df..a31c97b 100644 --- a/src/app/services/rendering/toc.ts +++ b/src/app/services/rendering/toc.ts @@ -190,7 +190,6 @@ export class TocRenderingService extends RenderingService implements ResizableOb let text = $(anchor).attr("title"); let parent = $(anchor).parent() as unknown as JQuery; let parentNodes: JQuery[] = parent.parents("ul>li") as unknown as JQuery[]; - let latest = parentNodes.length > 0 ? parentNodes[parentNodes.length - 1] : parent; for (let i = 0; i < parentNodes.length; i++) { let parentText; let parentNode = $(parentNodes[i]);