Sha256: f05334e68c06ea6e4fbabf7f2b2a5bb968f91cf5fcb8270bfe9bf32d88c34c71
Contents?: true
Size: 647 Bytes
Versions: 19
Compression:
Stored size: 647 Bytes
Contents
/** * Handles quoting rules for a font family name in css. * @constructor */ webfont.CssFontFamilyName = function() { /** @type {string} */ this.quote_ = "'"; }; /** * Quotes the name. * @param {string} name The name to quote. * @return {string} The quoted name. */ webfont.CssFontFamilyName.prototype.quote = function(name) { var quoted = []; var split = name.split(/,\s*/); for (var i = 0; i < split.length; i++) { var part = split[i].replace(/['"]/g, ''); if (part.indexOf(' ') == -1) { quoted.push(part); } else { quoted.push(this.quote_ + part + this.quote_); } } return quoted.join(','); };
Version data entries
19 entries across 19 versions & 1 rubygems