Skip to content

Commit 2f8784e

Browse files
KyleFairnsfzankl
authored andcommitted
Fixes Issue #7 (#8)
#7 Font Awesome Icon settings weren't being pulled in correctly. The regex used didn't match hyphens, and the regex failed to match font awesome icons, which regularly include hyphens
1 parent 7573efe commit 2f8784e

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

src/index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ import styles from './style.css';
4848
const options = mergeObjects(CONFIG, vm.config['flexible-alerts'] || vm.config.flexibleAlerts);
4949

5050
const findSetting = function findAlertSetting(input, key, fallback, callback) {
51-
const match = (input || '').match(new RegExp(`${key}:(([\\s\\w\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF]*))`));
51+
const match = (input || '').match(new RegExp(`${key}:(([\\s\\w\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF-]*))`));
5252

5353
if (!match) {
5454
return callback ? callback(fallback) : fallback;
@@ -58,7 +58,7 @@ import styles from './style.css';
5858
};
5959

6060
hook.afterEach(function (html, next) {
61-
const modifiedHtml = html.replace(/<\s*blockquote[^>]*>(?:<p>|[\S\n]*)?\[!(\w*)((?:\|[\w*:[\s\w\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]*)*?)\]([\s\S]*?)(?:<\/p>)?<\s*\/\s*blockquote>/g, function (match, key, settings, value) {
61+
const modifiedHtml = html.replace(/<\s*blockquote[^>]*>(?:<p>|[\S\n]*)?\[!(\w*)((?:\|[\w*:[\s\w\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF-]*)*?)\]([\s\S]*?)(?:<\/p>)?<\s*\/\s*blockquote>/g, function (match, key, settings, value) {
6262
const config = options[key.toLowerCase()];
6363

6464
if (!config) {

0 commit comments

Comments
 (0)