mirror of
https://codeberg.org/streams/streams.git
synced 2024-09-20 02:15:19 +00:00
don't link hashtags inside HTML tags, add support for HTML 'mark' element in the purifier.
This commit is contained in:
parent
edd2737f56
commit
5445aa8dbe
1 changed files with 3 additions and 2 deletions
|
@ -283,7 +283,7 @@ function purify_html($s, $opts = []) {
|
||||||
$def->addElement('footer', 'Block', 'Flow', 'Common');
|
$def->addElement('footer', 'Block', 'Flow', 'Common');
|
||||||
//Inline
|
//Inline
|
||||||
$def->addElement('button', 'Inline', 'Inline', 'Common');
|
$def->addElement('button', 'Inline', 'Inline', 'Common');
|
||||||
|
$def->addElement('mark', 'Inline', 'Inline', 'Common');
|
||||||
|
|
||||||
if(in_array('allow_position', $opts)) {
|
if(in_array('allow_position', $opts)) {
|
||||||
$cssDefinition = $config->getCSSDefinition();
|
$cssDefinition = $config->getCSSDefinition();
|
||||||
|
@ -846,9 +846,10 @@ function get_tags($s) {
|
||||||
$ret = [];
|
$ret = [];
|
||||||
$match = [];
|
$match = [];
|
||||||
|
|
||||||
// ignore anything in a code or svg block
|
// ignore anything in a code or svg block or HTML tag
|
||||||
|
|
||||||
$s = preg_replace('/\[code(.*?)\](.*?)\[\/code\]/sm','',$s);
|
$s = preg_replace('/\[code(.*?)\](.*?)\[\/code\]/sm','',$s);
|
||||||
|
$s = preg_replace('/\<(.*?)\>/sm','',$s);
|
||||||
$s = preg_replace('/\[svg(.*?)\](.*?)\[\/svg\]/sm','',$s);
|
$s = preg_replace('/\[svg(.*?)\](.*?)\[\/svg\]/sm','',$s);
|
||||||
|
|
||||||
// ignore anything in [style= ]
|
// ignore anything in [style= ]
|
||||||
|
|
Loading…
Reference in a new issue