From dc1d16c2765ae2fc902a2a75e900109683a660f2 Mon Sep 17 00:00:00 2001 From: alistair3149 Date: Tue, 19 Nov 2024 14:35:14 -0500 Subject: [PATCH] fix: properly wrap text in paragraph if it is a wikitext link Seems to be related to #151 --- includes/Tabber.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/includes/Tabber.php b/includes/Tabber.php index 3fd9a01..7969eaa 100644 --- a/includes/Tabber.php +++ b/includes/Tabber.php @@ -165,11 +165,11 @@ class Tabber { } if ( !self::$useCodex ) { - $wikitextListMarkers = [ '*', '#', ';', ':' ]; - $isWikitextList = in_array( substr( $content, 0, 1 ), $wikitextListMarkers ); - if ( $isWikitextList ) { - // Fix #151, some wikitext magic - // Seems like there is no way to get rid of the mw-empty-elt paragraphs sadly + // Insert a new line for these characters in wikitext (#151) + // Seems like there is no way to get rid of the mw-empty-elt paragraphs sadly + $wikitextCharacters = [ '*', '#', ';', ':', '[' ]; + $needsNewLine = in_array( substr( $content, 0, 1 ), $wikitextCharacters ); + if ( $needsNewLine ) { $content = "\n$content\n"; } return $parser->recursiveTagParse( $content, $frame );