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.
This commit is contained in:
parent
90106df0f6
commit
3c942b4b8f
@ -63,10 +63,11 @@ Future<void> reorganizeHtml() async {
|
|||||||
linkifyImg();
|
linkifyImg();
|
||||||
|
|
||||||
// Add correct class to TOC
|
// Add correct class to TOC
|
||||||
final toc = (querySelector('#table-of-contents') ?? Element.div()
|
final toc = (querySelector('#table-of-contents') ??
|
||||||
..attributes['id'] = 'table-of-contents')
|
(Element.div()
|
||||||
..classes.add('dropdown')
|
..attributes['id'] = 'table-of-contents'
|
||||||
..innerText = "Table of Contents Unavailable";
|
..innerText = "Table of Contents Unavailable"))
|
||||||
|
..classes.add('dropdown');
|
||||||
querySelector('#toc-drop').append(toc);
|
querySelector('#toc-drop').append(toc);
|
||||||
|
|
||||||
// Remove all <br> tags from HTML
|
// Remove all <br> tags from HTML
|
||||||
|
Reference in New Issue
Block a user