Skip to content

Commit

Permalink
Fixes Issue #7 (#8)
Browse files Browse the repository at this point in the history
#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
  • Loading branch information
KyleFairns authored and fzankl committed Sep 23, 2019
1 parent 7573efe commit 2f8784e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ import styles from './style.css';
const options = mergeObjects(CONFIG, vm.config['flexible-alerts'] || vm.config.flexibleAlerts);

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

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

hook.afterEach(function (html, next) {
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) {
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) {
const config = options[key.toLowerCase()];

if (!config) {
Expand Down

0 comments on commit 2f8784e

Please sign in to comment.