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
This commit is contained in:
Sarjuuk
2025-10-22 18:03:11 +02:00
parent f522c960d9
commit 6ea1457c4f
3 changed files with 4 additions and 3 deletions

View File

@@ -0,0 +1 @@
UPDATE `aowow_dbversion` SET `build` = CONCAT(IFNULL(`build`, ''), ' globaljs');

View File

@@ -3126,7 +3126,7 @@ var Markup = {
str += "<li><b><a href='#guide-changelog' onclick=\"Markup.toggleReveal('changelog');\">Changelog</a></b></li>";
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 += '<li><b><a href=\'#' + (node.attr.id ? g_urlize(node.attr.id) : g_urlize(node.attr._textContents)) + '\'>' + node.attr._textContents + '</a></b></li>';
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')
{

View File

@@ -295,7 +295,7 @@ endif;
}
updateQfPreview();
}).bind(this), 50)"><?=Lang::guide('editor', 'autoupdate');?></label></h2>
<div id="guide-body"><div id="livePreview" style="margin-right:10px"></div></div>
<div id="guide-body" class="text"><div id="livePreview" style="margin-right:10px"></div></div>
<script>updatePreview(true);</script>
</div>
</div>