"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "src/formatter/highlight/html.php" between
wacko.6.1.14.zip and wacko.6.1.15.zip

About: WackoWiki is a multilingual Wiki-engine that supports WYTIWYG-editing, page rights (ACLs), design themes (skins), file upload, email notification and much more.

html.php  (wacko.6.1.14):html.php  (wacko.6.1.15)
skipping to change at line 24 skipping to change at line 24
$options['line_numbers'] = $options['numbers'] ?? false; $options['line_numbers'] = $options['numbers'] ?? false;
$html_tags = [ $html_tags = [
'!DOCTYPE', '!DOCTYPE',
'a', 'a',
'abbr', 'abbr',
'acronym', 'acronym',
'address', 'address',
'applet', 'applet',
'area', 'area',
'article', // HTML5 'article',
'aside', // HTML5 'aside',
'audio', // HTML5 'audio',
'b', 'b',
'base', 'base',
'basefont', 'basefont',
'bgsound', 'bgsound',
'bdi', // HTML5 'bdi',
'bdo', 'bdo',
'big', 'big',
'blink', 'blink',
'blockquote', 'blockquote',
'body', 'body',
'br', 'br',
'button', 'button',
'canvas', // HTML5 'canvas',
'caption', 'caption',
'center', 'center',
'cite', 'cite',
'code', 'code',
'col', 'col',
'colgroup', 'colgroup',
'comment', 'comment',
'datalist', // HTML5 'datalist',
'dd', 'dd',
'del', 'del',
'details', // HTML5 'details',
'dfn', 'dfn',
'dir', 'dir',
'div', 'div',
'dl', 'dl',
'dt', 'dt',
'em', 'em',
'embed', 'embed',
'fieldset', 'fieldset',
'figcaption', // HTML5 'figcaption',
'figure', // HTML5 'figure',
'font', 'font',
'footer', // HTML5 'footer',
'form', 'form',
'frame', 'frame',
'frameset', 'frameset',
'h', 'h',
'h1', 'h1',
'h2', 'h2',
'h3', 'h3',
'h4', 'h4',
'h5', 'h5',
'h6', 'h6',
'head', 'head',
'header', // HTML5 'header',
'hgroup', // HTML5 'hgroup',
'hr', 'hr',
'hta:application', 'hta:application',
'html', 'html',
'i', 'i',
'iframe', 'iframe',
'img', 'img',
'input', 'input',
'ins', 'ins',
'isindex', 'isindex',
'kbd', 'kbd',
'keygen', // HTML5 'keygen',
'label', 'label',
'legend', 'legend',
'li', 'li',
'link', 'link',
'listing', 'listing',
'main', // HTML5 'main',
'map', 'map',
'mark', 'mark',
'marquee', 'marquee',
'menu', 'menu',
'meta', 'meta',
'meter', // HTML5 'meter',
'multicol', 'multicol',
'nav', // HTML5 'nav',
'nextid', 'nextid',
'nobr', 'nobr',
'noframes', 'noframes',
'noscript', 'noscript',
'object', 'object',
'ol', 'ol',
'optgroup', 'optgroup',
'option', 'option',
'output', // HTML5 'output',
'p', 'p',
'param', 'param',
'plaintext', 'plaintext',
'pre', 'pre',
'progress', // HTML5 'progress',
'q', 'q',
'ruby', // HTML5 'ruby',
'rp', // HTML5 'rp',
'rt', // HTML5 'rt',
's', 's',
'samp', 'samp',
'script', 'script',
'section', // HTML5 'section',
'select', 'select',
'server', 'server',
'small', 'small',
'sound', 'sound',
'spacer', 'spacer',
'span', 'span',
'strike', 'strike',
'strong', 'strong',
'style', 'style',
'sub', 'sub',
'summary', // HTML5 'summary',
'sup', 'sup',
'svg', // HTML5 'svg',
'table', 'table',
'tbody', 'tbody',
'td', 'td',
'template', // HTML5 'template',
'textarea', 'textarea',
'textflow', 'textflow',
'tfoot', 'tfoot',
'th', 'th',
'thead', 'thead',
'time', // HTML5 'time',
'title', 'title',
'tr', 'tr',
'track', // HTML5 'track',
'tt', 'tt',
'u', 'u',
'ul', 'ul',
'var', 'var',
'video', // HTML5 'video',
'wbr', 'wbr',
'xmp' 'xmp'
]; ];
$source = Ut::html($text); $source = Ut::html($text);
$source = preg_replace_callback( $source = preg_replace_callback(
'/<!--(.*?)-->/us', '/<!--(.*?)-->/us',
function ($matches) use ($options) function ($matches) use ($options)
{ {
return return
'<span style="color: ' . $options['color']['comme '<span style="color: ' . $options['color']['comment'] . '
nt'] . ';">&lt;!--' . ;">&lt;!--' .
str_replace('&lt;', '&lt;<!-- -->', str_replace('&lt;', '&lt;<!-- -->',
str_replace('=', '=<!-- -->', str_replace('=', '=<!-- -->',
$matches[1])) . $matches[1])) .
'--&gt;</span>'; '--&gt;</span>';
}, },
$source); $source);
$source = preg_replace_callback( $source = preg_replace_callback(
'/(&lt;style.*?&gt;)(.*?)&lt;\/style&gt;/us', '/(&lt;style.*?&gt;)(.*?)&lt;\/style&gt;/us',
function ($matches) function ($matches)
{ {
return return
$matches[1] . $matches[1] .
$this->format($matches[2], 'highlight/css', ['nop $this->format($matches[2], 'highlight/css', ['nopre' => t
re' => true, 'notypo' => false]) . rue, 'notypo' => false]) .
'&lt;/style&gt;'; '&lt;/style&gt;';
}, },
$source); $source);
foreach ($html_tags as $i)
{
$source = preg_replace(
'/&lt;' . $i . '(&gt;|[[:space:]])/u',
'<span style="color: ' . $options['color']['tags'
] . ';font-weight:bold;">&lt;' . $i . '\\1</span>',
$source);
$source = str_replace(
'&lt;/' . $i . '&gt;',
'<span style="color: ' . $options['color']['tags'
] . ';font-weight:bold;">&lt;/' . $i . '&gt;</span>',
$source);
}
$source = str_replace( foreach ($html_tags as $i)
'/&gt;', {
'<span style="color: ' . $options['color']['tags'] . ';fo $source = preg_replace(
nt-weight:bold;">/&gt;</span>', '/&lt;' . $i . '(&gt;|[[:space:]])/u',
'<span style="color: ' . $options['color']['tags'] . ';fo
nt-weight:bold;">&lt;' . $i . '\\1</span>',
$source); $source);
$source = preg_replace( $source = str_replace(
'/([[:space:]]|&quot;|\'|\?)&gt;/u', '&lt;/' . $i . '&gt;',
'\\1<span style="color: ' . $options['color']['tags'] . ' '<span style="color: ' . $options['color']['tags'] . ';fo
;font-weight:bold;">&gt;</span>', nt-weight:bold;">&lt;/' . $i . '&gt;</span>',
$source); $source);
}
$source = preg_replace( $source = str_replace(
'/([a-z-]+)=(&quot;|\')(.*?)\\2/ui', '/&gt;',
'<span style="color: ' . $options['color']['attributes'] '<span style="color: ' . $options['color']['tags'] . ';font-weigh
. ';font-weight:bold;">$1=</span><span style="color: ' . t:bold;">/&gt;</span>',
$options['color']['attributevalues'] . ';">$2$3$2</span>' $source);
, $source);
$source = preg_replace("/&amp;([a-z\d]*?;)/ui", '&amp;<sp
an style="color: ' . $options['color']['entities'] . ';">$1</span>', $source);
if ($options['line_numbers']) $source = preg_replace(
{ '/([[:space:]]|&quot;|\'|\?)&gt;/u',
$lines = preg_split("/(\n|<br \/>)/us", $source); '\\1<span style="color: ' . $options['color']['tags'] . ';font-we
$source = '<ol>'; ight:bold;">&gt;</span>',
$i = 0; $source);
foreach ($lines as $line) $source = preg_replace(
{ '/([a-z-]+)=(&quot;|\')(.*?)\\2/ui',
$i += 1; '<span style="color: ' . $options['color']['attributes'] . ';font
$source .= '<li id="l' . $i . '">' . rtrim($line) . "</li -weight:bold;">$1=</span><span style="color: ' .
>"; $options['color']['attributevalues'] . ';">$2$3$2</span>', $sourc
} e);
$source = preg_replace("/&amp;([a-z\d]*?;)/ui", '&amp;<span style
="color: ' . $options['color']['entities'] . ';">$1</span>', $source);
if ($options['line_numbers'])
{
$lines = preg_split("/(\n|<br \/>)/us", $source);
$source = '<ol>';
$i = 0;
$source .= '</ol>'; foreach ($lines as $line)
{
$i += 1;
$source .= '<li id="l' . $i . '">' . rtrim($line) . "</li>";
} }
echo '<!--notypo-->'; $source .= '</ol>';
echo '<pre class="code">'; }
echo str_replace("\t", " ", $source);
echo "</pre>"; // output source
echo '<!--/notypo-->'; $tpl->text = str_replace("\t", " ", $source);
 End of changes. 32 change blocks. 
97 lines changed or deleted 93 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)