+++ /dev/null
-(function() {
- var OPEN_BRACE = '{';
- var SEMICOLON = ';';
- var COLON = ':';
-
- var PropertyScanner = function PropertyScanner(data) {
- this.data = data;
- };
-
- PropertyScanner.prototype.nextAt = function(cursor) {
- var lastColon = this.data.lastIndexOf(COLON, cursor);
- var lastOpenBrace = this.data.lastIndexOf(OPEN_BRACE, cursor);
- var lastSemicolon = this.data.lastIndexOf(SEMICOLON, cursor);
- var startAt = Math.max(lastOpenBrace, lastSemicolon);
-
- return this.data.substring(startAt + 1, lastColon).trim();
- };
-
- module.exports = PropertyScanner;
-})();
+++ /dev/null
-(function() {
- var QuoteScanner = require('../utils/quote-scanner');
- var PropertyScanner = require('../properties/scanner');
-
- var NameQuotes = function NameQuotes() {};
-
- var STRIPPABLE = /^['"][a-zA-Z][a-zA-Z\d\-_]+['"]$/;
-
- var properties = [
- 'animation',
- '-moz-animation',
- '-o-animation',
- '-webkit-animation',
- 'animation-name',
- '-moz-animation-name',
- '-o-animation-name',
- '-webkit-animation-name',
- 'font',
- 'font-family'
- ];
-
- NameQuotes.prototype.process = function(data) {
- var scanner = new PropertyScanner(data);
-
- return new QuoteScanner(data).each(function(match, store, cursor) {
- var lastProperty = scanner.nextAt(cursor);
- if (properties.indexOf(lastProperty) > -1) {
- if (STRIPPABLE.test(match))
- match = match.substring(1, match.length - 1);
- }
-
- store.push(match);
- });
- };
-
- module.exports = NameQuotes;
-})();