From 6ea1457c4f086a55a5e2eed2ab89f874370827e0 Mon Sep 17 00:00:00 2001 From: Sarjuuk Date: Wed, 22 Oct 2025 18:03:11 +0200 Subject: [PATCH] Guides/Fixup * make preview area of class: text so styles are applied as expected * fix evaluation of Markup h2/h3 attribute toc=false, so headings are excluded from TOC as expected --- setup/sql/updates/1761148832_01.sql | 1 + setup/tools/filegen/templates/global.js/markup.js | 4 ++-- template/pages/guide-edit.tpl.php | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) create mode 100644 setup/sql/updates/1761148832_01.sql diff --git a/setup/sql/updates/1761148832_01.sql b/setup/sql/updates/1761148832_01.sql new file mode 100644 index 00000000..03adf418 --- /dev/null +++ b/setup/sql/updates/1761148832_01.sql @@ -0,0 +1 @@ +UPDATE `aowow_dbversion` SET `build` = CONCAT(IFNULL(`build`, ''), ' globaljs'); diff --git a/setup/tools/filegen/templates/global.js/markup.js b/setup/tools/filegen/templates/global.js/markup.js index 97f2e128..285fbc9a 100644 --- a/setup/tools/filegen/templates/global.js/markup.js +++ b/setup/tools/filegen/templates/global.js/markup.js @@ -3126,7 +3126,7 @@ var Markup = { str += "
  • Changelog
  • "; lastNode = "h2"; } - if (node.name == 'h2' && node.attr.toc !== false) + if (node.name == 'h2' && node.attr.toc !== 'false') { if (lastNode == 'h3') { @@ -3136,7 +3136,7 @@ var Markup = { str += '
  • ' + node.attr._textContents + '
  • '; lastNode = 'h2'; } - if (node.name == 'h3' && allowH3 && node.attr.toc !== false && (lastNode != '' || nodes.h2.length == 0)) + if (node.name == 'h3' && allowH3 && node.attr.toc !== 'false' && (lastNode != '' || nodes.h2.length == 0)) { if (lastNode == 'h2') { diff --git a/template/pages/guide-edit.tpl.php b/template/pages/guide-edit.tpl.php index 9f6f2eec..b497929c 100644 --- a/template/pages/guide-edit.tpl.php +++ b/template/pages/guide-edit.tpl.php @@ -295,7 +295,7 @@ endif; } updateQfPreview(); }).bind(this), 50)"> -
    +