From 3c942b4b8ffb05dcfb1951ad4fb2eda77627625d Mon Sep 17 00:00:00 2001 From: Lucien Cartier-Tilet Date: Sat, 9 May 2020 14:45:26 +0200 Subject: [PATCH] Fixes bug introduced in e819866 Table of content was made unavailable regardless of whether one was provided by the page or not. This commit fixes this issue by making an unavailable TOC only if one is not provided by the web page, otherwise the TOC will be available. --- web/dart/reorganize_html.dart | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/web/dart/reorganize_html.dart b/web/dart/reorganize_html.dart index 0f45114..3182cdf 100644 --- a/web/dart/reorganize_html.dart +++ b/web/dart/reorganize_html.dart @@ -63,10 +63,11 @@ Future reorganizeHtml() async { linkifyImg(); // Add correct class to TOC - final toc = (querySelector('#table-of-contents') ?? Element.div() - ..attributes['id'] = 'table-of-contents') - ..classes.add('dropdown') - ..innerText = "Table of Contents Unavailable"; + final toc = (querySelector('#table-of-contents') ?? + (Element.div() + ..attributes['id'] = 'table-of-contents' + ..innerText = "Table of Contents Unavailable")) + ..classes.add('dropdown'); querySelector('#toc-drop').append(toc); // Remove all
tags from HTML