links in part line comments (code)
This commit is contained in:
@@ -178,8 +178,17 @@ class Reader extends PhpObject
|
||||
//Enlarge line
|
||||
//if(mb_strpos($sLine, $sServName) !== false) $sLiClass .= ' bigline';
|
||||
|
||||
//Comments (entire line)
|
||||
//Comments (entire line and partline)
|
||||
$bComment = in_array($sFirstChar, $this->getWords('cComment'));
|
||||
$sQuote = '"';
|
||||
$sQuoteLen = strlen($sQuote);
|
||||
$iPartCommentPos = mb_strpos($sLine, $sQuote);
|
||||
|
||||
//Internal & external Urls
|
||||
if($bComment) $sLine = Toolbox::findReplaceLinks($sLine);
|
||||
elseif($iPartCommentPos!==false) $sLine = substr($sLine, 0, $iPartCommentPos+$sQuoteLen).Toolbox::findReplaceLinks(substr($sLine, $iPartCommentPos+$sQuoteLen));
|
||||
|
||||
//Common base line
|
||||
$sLine = '<li id="'.($iLineNb+1).'" class="round_right '.$sLiClass.'">'.
|
||||
'<span class="expand_line">'.$sExpandButton.'</span>'.
|
||||
'<span class="'.($bComment?'comment':'code').'">'.$sLine.'</span>'.
|
||||
@@ -190,7 +199,7 @@ class Reader extends PhpObject
|
||||
{
|
||||
$sKey = '§'.$iLineNb.'§';
|
||||
$sPattern = '`'.preg_quote($sKey).'`su';
|
||||
$asCommentLines[$sPattern] = Toolbox::findReplaceLinks($sLine); //links only in comments
|
||||
$asCommentLines[$sPattern] = $sLine;
|
||||
$sLine = $sKey;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user