Skip to content

Commit

Permalink
conditionally allow style attribute for ul and ol tags
Browse files Browse the repository at this point in the history
  • Loading branch information
i-just committed Sep 11, 2023
1 parent 909223e commit 6460e9a
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/Field.php
Original file line number Diff line number Diff line change
Expand Up @@ -849,6 +849,18 @@ private function _adjustPurifierConfig(HTMLPurifier_Config $purifierConfig): HTM
]);
}

if (in_array('numberedList', $ckeConfig->toolbar)) {
/** @var HTMLPurifier_HTMLDefinition|null $def */
$def = $purifierConfig->getDefinition('HTML', true);
$def?->addAttribute('ol', 'style', 'Text');
}

if (in_array('bulletedList', $ckeConfig->toolbar)) {
/** @var HTMLPurifier_HTMLDefinition|null $def */
$def = $purifierConfig->getDefinition('HTML', true);
$def?->addAttribute('ul', 'style', 'Text');
}

return $purifierConfig;
}
}

0 comments on commit 6460e9a

Please sign in to comment.