add link to tables in error messages

This commit is contained in:
2014-09-06 00:12:03 +02:00
parent ecc3471ebc
commit 3f63181ec3
4 changed files with 32 additions and 30 deletions

View File

@@ -276,8 +276,8 @@ class ToolBox
//Phase 3: Rebuild link
$asPatterns = array();
$sPreChar = '(^|\ |\*|\')';
$sPostChar = '(\ |\.|\:|$)';
$sPreChar = '(^|\ |\*|\'|\()';
$sPostChar = '(\ |\.|\:|\)|$)';
foreach($asReplacements as $sHash=>$sPage)
{
if(mb_strlen($sHash)>1)
@@ -288,7 +288,7 @@ class ToolBox
$asPatterns['`'.$sPreChar.$sHash.'\ ([\d]+)'.$sPostChar.'`mui'] = '$1<a href="#'.$sPage.'-$2" target="_blank" class="internal_link round"><i class="fa fa-inline fa-c-'.$sPage.'"></i><span class="type">'.$sTitle.'</span> n°<span class="item">$2</span></a>$3';
//Type + phrase
if($sPage=='table') $asPatterns['`'.$sPreChar.'(?i)'.$sHash.'(?-i)\ ([_A-Z0-9]+)'.$sPostChar.'`mu'] = '$1<a href="#'.$sPage.'-$2" target="_blank" class="internal_link round"><i class="fa fa-inline fa-c-'.$sPage.'"></i><span class="type">'.$sTitle.'</span> <span class="item">$2</span></a>$3';
if($sPage=='table') $asPatterns['`'.$sPreChar.'(?i)'.$sHash.'(?-i)\ ([_A-Z0-9\*\/]+)'.$sPostChar.'`mu'] = '$1<a href="#'.$sPage.'-$2" target="_blank" class="internal_link round"><i class="fa fa-inline fa-c-'.$sPage.'"></i><span class="type">'.$sTitle.'</span> <span class="item">$2</span></a>$3';
}
}
$sText = preg_replace(array_keys($asPatterns), array_values($asPatterns), $sText);