From 5a8e54eab27b110cd8d42ffb55dc6cf35b1ad593 Mon Sep 17 00:00:00 2001 From: Daniel Kraus Date: Wed, 3 Sep 2014 15:06:30 +0200 Subject: [PATCH] Do not link template parameters. --- LinkTitles.body.php | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/LinkTitles.body.php b/LinkTitles.body.php index 9d13363..bd484d3 100755 --- a/LinkTitles.body.php +++ b/LinkTitles.body.php @@ -119,7 +119,15 @@ { $templatesDelimiter = '{{[^}]+}}|'; } else { - $templatesDelimiter = '{{[^|]*?(?:(?:\[\[[^]]+]])?)[^|]*?(?:\||(?:}}))|'; + // Match template names (ignoring any piped [[]] links in them) + // along with the trailing pipe and parameter name or closing + // braces; also match sequences of '|wordcharacters=' (without + // spaces in them) that usually only occur as parameter names in + // transclusions (but could also occur as wiki table cell contents). + // TODO: Find a way to match parameter names in transclusions, but + // not in table cells or other sequences involving a pipe character + // and equal sign. + $templatesDelimiter = '{{[^|]*?(?:(?:\[\[[^]]+]])?)[^|]*?(?:\|(?:\w+=)?|(?:}}))|\|\w+=|'; }; LinkTitles::$currentTitle = $title;