mirror of
https://github.com/Ionaru/easy-markdown-editor
synced 2025-06-30 06:31:01 -06:00
Improve icon class regex
This commit is contained in:
parent
14bfa678ab
commit
dd0e96b204
@ -145,8 +145,8 @@ function createToolbarButton(options, enableTooltips, shortcuts) {
|
||||
for (var classNameIndex = 0; classNameIndex < classNameParts.length; classNameIndex++) {
|
||||
var classNamePart = classNameParts[classNameIndex];
|
||||
// Split icon classes from the button.
|
||||
// Regex will detect "fa" and "fa-something", but not "fanfare".
|
||||
if (classNamePart.match(/^fa((-.*)|$)/)) {
|
||||
// Regex will detect "fa", "fas", "fa-something" and "fa-some-icon-1", but not "fanfare".
|
||||
if (classNamePart.match(/^fa([srlb]|(-[\w-]*)|$)/)) {
|
||||
iconClasses.push(classNamePart);
|
||||
} else {
|
||||
el.classList.add(classNamePart);
|
||||
|
Loading…
x
Reference in New Issue
Block a user