From 28b7b0202efdc0f369ef1898f5326df1de8f8b17 Mon Sep 17 00:00:00 2001 From: pvbergen Date: Sat, 6 Sep 2014 11:59:28 +0200 Subject: [PATCH 1/2] Sanitized input to hexToRGB CSS extractor broke in hexToRGB due to variable hex being undefined. I "fixed" this by returning an object encoding black if the input is null. This may lead to unexpected side effects, but the extractor is working again. --- reflowCSSExtractor.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/reflowCSSExtractor.js b/reflowCSSExtractor.js index bead16f..b6b6192 100644 --- a/reflowCSSExtractor.js +++ b/reflowCSSExtractor.js @@ -741,6 +741,9 @@ var ReflowCSSExtractor = function (csscontent) { }; this.hexToRGB = function (hex) { + if (hex == null) { + return {r: 0, g:0, b:0}; + } // Expand shorthand form (e.g. "03F") to full form (e.g. "0033FF") var shorthandRegex = /^#?([a-f\d])([a-f\d])([a-f\d])$/i; hex = hex.replace(shorthandRegex, function (m, r, g, b) { @@ -799,4 +802,4 @@ var ReflowCSSExtractor = function (csscontent) { }; -}; \ No newline at end of file +}; From afa663f57045efb2c6872793a00afc88b0ba2520 Mon Sep 17 00:00:00 2001 From: pvbergen Date: Sat, 6 Sep 2014 12:15:45 +0200 Subject: [PATCH 2/2] Update README.md --- README.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/README.md b/README.md index 6a4dfe7..04fc392 100644 --- a/README.md +++ b/README.md @@ -2,6 +2,9 @@ This extension hopes to clean the HTML that Adobe Edge Reflow makes in order to provide a better starting spot for hand coded projects. +## Author +The author of this extension is Terrence Ryan (https://github.com/tpryan). I merely added a workaround to get the CSS extractor to work again with a new version of Brackets/Adobe Edge Code CC. + ## Abilities Currently the project does the following: