See also WikiPatches/DivTags.
As nested div with wikitext
sub WikiToHTML { ... while (@HeadingNumbers) { pop @HeadingNumbers; $TableOfContents .= "</dd></dl>\n\n"; } - $pageText =~ s/<toc>/$TableOfContents/gi; + $IniToc = '<div class=wikitoc>'; + $EndToc = '</div>'; + $pageText =~ s/<toc>/$IniToc$TableOfContents$EndToc/gi; if ($LateRules ne '') { $pageText = &EvalLocalRules($LateRules, $pageText, 0); } ...
As separate div with wikitext:
sub BrowsePage { ... $revision, $newText); $fullHtml .= "<hr class=wikilinediff>\n"; } - $fullHtml .= '<div class=wikitext>'; $fullHtml .= &WikiToHTML($Text{'text'}); $fullHtml .= '</div>'; ... sub WikiToHTML { ... while (@HeadingNumbers) { pop @HeadingNumbers; $TableOfContents .= "</dd></dl>\n\n"; } - $pageText =~ s/<toc>/$TableOfContents/gi; + $IniToc = '<div class=wikitoc>'; + $EndToc = '</div><div class=wikitext>'; + $pageText =~ s/<toc>/$IniToc$TableOfContents$EndToc/gi; if ($LateRules ne '') { $pageText = &EvalLocalRules($LateRules, $pageText, 0); } + if (!$TableOfContents ) { + return '<div class=wikitext>'.&RestoreSavedText($pageText); + } else { return &RestoreSavedText($pageText); + } } sub DoEdit { ... print "<h2>", T('Preview only, not yet saved'), "</h2>\n"; print '</div>'; + print '</div>'; # closed div wikitext if WikiPatches/WikiTOCDivTag applied } print $q->endform; if (!&GetParam('embed', $EmbedWiki)) { print '<div class=wikifooter>'; ... In both pacths: <tt> # Other global variables:</tt> <pre> use vars qw( ... $IniToc $EndToc ...
I prefer the second one. --JuanmaMP