From 50347112a6e096e7aa6d37757b118b9b75e27859 Mon Sep 17 00:00:00 2001 From: Ian Prest Date: Tue, 29 Sep 2015 23:02:14 -0400 Subject: [PATCH] Fixed a problem parsing Font Awesome's CSS file; also updated FA to 4.4.0. --- bower.json | 2 +- render.js | 18 ++++++++++-------- 2 files changed, 11 insertions(+), 9 deletions(-) diff --git a/bower.json b/bower.json index 4134a5a..0ced06e 100644 --- a/bower.json +++ b/bower.json @@ -40,7 +40,7 @@ "crypto-js": "3.1.5", "ng-file-upload": "5.0.9", "angular-ui-bootstrap": "0.12.0", - "fontawesome": "4.3.0", + "fontawesome": "4.4.0", "hint.css": "1.3.5", "angular-cookies": "1.2.28", "ace-builds": "1.2.0", diff --git a/render.js b/render.js index 983eea8..9888a00 100644 --- a/render.js +++ b/render.js @@ -213,15 +213,17 @@ var $renderKey = (typeof(exports) !== 'undefined') ? exports : {}; // Find rules that look like glyphs var glyphs = []; rules.forEach(function(rule) { - if(!rule.name && rule.selector.length === 1) { - var matches = rule.selector[0].match(/^\.([a-zA-Z0-9]+)-([-a-zA-Z0-9]+)\:(before|after)$/); - if(matches) { - var theClass = classes.indexOf(matches[1]); - if(theClass != -1) { - var glyph = { name: matches[2], html: "" }; - glyphs.push(glyph); + if(!rule.name && rule.selector.length > 0) { + rule.selector.forEach(function(selector) { + var matches = selector.match(/^\.([a-zA-Z0-9]+)-([-a-zA-Z0-9]+)\:(before|after)$/); + if(matches) { + var theClass = classes.indexOf(matches[1]); + if(theClass != -1) { + var glyph = { name: matches[2], html: "" }; + glyphs.push(glyph); + } } - } + }); } }); glyphs.sort(function(a,b) { return a.name.localeCompare(b.name); });