Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
// fail-safe
try {
var ref = args[0];
if (REF_PATTERN.test(ref)) {
ref = ref.replace(REF_PATTERN, '');
args.shift();
} else {
ref = null;
}
var entry = {
category: category,
ref: ref,
message: format.apply(null, args)
};
this.entries.push(entry);
} catch (e) {
console.error(e);
}
};
let filtersFromProfile = (profile && profile['filters']) ? profile['filters'].split(',') : [];
filtersFromProfile = filtersFromProfile.map(filterFromProfile => filterFromProfile.trim());
// Update profile based on preferences
if (emmetConfig['preferences']['format.noIndentTags']) {
if (Array.isArray(emmetConfig['preferences']['format.noIndentTags'])) {
profile['formatSkip'] = emmetConfig['preferences']['format.noIndentTags'];
}
else if (typeof emmetConfig['preferences']['format.noIndentTags'] === 'string') {
profile['formatSkip'] = emmetConfig['preferences']['format.noIndentTags'].split(',');
}
}
if (emmetConfig['preferences']['format.forceIndentationForTags']) {
if (Array.isArray(emmetConfig['preferences']['format.forceIndentationForTags'])) {
profile['formatForce'] = emmetConfig['preferences']['format.forceIndentationForTags'];
}
else if (typeof emmetConfig['preferences']['format.forceIndentationForTags'] === 'string') {
profile['formatForce'] = emmetConfig['preferences']['format.forceIndentationForTags'].split(',');
}
}
if (emmetConfig['preferences']['profile.allowCompactBoolean'] && typeof emmetConfig['preferences']['profile.allowCompactBoolean'] === 'boolean') {
profile['compactBooleanAttributes'] = emmetConfig['preferences']['profile.allowCompactBoolean'];
}
// Fetch Add Ons
let addons = {};
if (filter && filter.split(',').find(x => x.trim() === 'bem') || filtersFromProfile.indexOf('bem') > -1) {
addons['bem'] = { element: '__' };
if (emmetConfig['preferences']['bem.elementSeparator']) {
addons['bem']['element'] = emmetConfig['preferences']['bem.elementSeparator'];
}
if (emmetConfig['preferences']['bem.modifierSeparator']) {
addons['bem']['modifier'] = emmetConfig['preferences']['bem.modifierSeparator'];
}
// Fetch Profile
let profile = getProfile(syntax, emmetConfig['syntaxProfiles']);
let filtersFromProfile: string[] = (profile && profile['filters']) ? profile['filters'].split(',') : [];
filtersFromProfile = filtersFromProfile.map(filterFromProfile => filterFromProfile.trim());
// Update profile based on preferences
if (emmetConfig['preferences']['format.noIndentTags']) {
if (Array.isArray(emmetConfig['preferences']['format.noIndentTags'])) {
profile['formatSkip'] = emmetConfig['preferences']['format.noIndentTags'];
} else if (typeof emmetConfig['preferences']['format.noIndentTags'] === 'string') {
profile['formatSkip'] = emmetConfig['preferences']['format.noIndentTags'].split(',');
}
}
if (emmetConfig['preferences']['format.forceIndentationForTags']) {
if (Array.isArray(emmetConfig['preferences']['format.forceIndentationForTags'])) {
profile['formatForce'] = emmetConfig['preferences']['format.forceIndentationForTags'];
} else if (typeof emmetConfig['preferences']['format.forceIndentationForTags'] === 'string') {
profile['formatForce'] = emmetConfig['preferences']['format.forceIndentationForTags'].split(',');
}
}
if (emmetConfig['preferences']['profile.allowCompactBoolean'] && typeof emmetConfig['preferences']['profile.allowCompactBoolean'] === 'boolean') {
profile['compactBooleanAttributes'] = emmetConfig['preferences']['profile.allowCompactBoolean'];
}
// Fetch Add Ons
let addons = {};
if (filter && filter.split(',').find(x => x.trim() === 'bem') || filtersFromProfile.indexOf('bem') > -1) {
addons['bem'] = { element: '__' };
if (emmetConfig['preferences']['bem.elementSeparator']) {
addons['bem']['element'] = emmetConfig['preferences']['bem.elementSeparator'];
// Fetch Profile
let profile = getProfile(syntax, emmetConfig['syntaxProfiles']);
let filtersFromProfile = (profile && profile['filters']) ? profile['filters'].split(',') : [];
filtersFromProfile = filtersFromProfile.map(filterFromProfile => filterFromProfile.trim());
// Update profile based on preferences
if (emmetConfig['preferences']['format.noIndentTags']) {
if (Array.isArray(emmetConfig['preferences']['format.noIndentTags'])) {
profile['formatSkip'] = emmetConfig['preferences']['format.noIndentTags'];
}
else if (typeof emmetConfig['preferences']['format.noIndentTags'] === 'string') {
profile['formatSkip'] = emmetConfig['preferences']['format.noIndentTags'].split(',');
}
}
if (emmetConfig['preferences']['format.forceIndentationForTags']) {
if (Array.isArray(emmetConfig['preferences']['format.forceIndentationForTags'])) {
profile['formatForce'] = emmetConfig['preferences']['format.forceIndentationForTags'];
}
else if (typeof emmetConfig['preferences']['format.forceIndentationForTags'] === 'string') {
profile['formatForce'] = emmetConfig['preferences']['format.forceIndentationForTags'].split(',');
}
}
if (emmetConfig['preferences']['profile.allowCompactBoolean'] && typeof emmetConfig['preferences']['profile.allowCompactBoolean'] === 'boolean') {
profile['compactBooleanAttributes'] = emmetConfig['preferences']['profile.allowCompactBoolean'];
}
// Fetch Add Ons
let addons = {};
if (filter && filter.split(',').find(x => x.trim() === 'bem') || filtersFromProfile.indexOf('bem') > -1) {
addons['bem'] = { element: '__' };
if (emmetConfig['preferences']['bem.elementSeparator']) {
addons['bem']['element'] = emmetConfig['preferences']['bem.elementSeparator'];
}
if (emmetConfig['preferences']['bem.modifierSeparator']) {
filtersFromProfile = filtersFromProfile.map(filterFromProfile => filterFromProfile.trim());
// Update profile based on preferences
if (emmetConfig['preferences']['format.noIndentTags']) {
if (Array.isArray(emmetConfig['preferences']['format.noIndentTags'])) {
profile['formatSkip'] = emmetConfig['preferences']['format.noIndentTags'];
}
else if (typeof emmetConfig['preferences']['format.noIndentTags'] === 'string') {
profile['formatSkip'] = emmetConfig['preferences']['format.noIndentTags'].split(',');
}
}
if (emmetConfig['preferences']['format.forceIndentationForTags']) {
if (Array.isArray(emmetConfig['preferences']['format.forceIndentationForTags'])) {
profile['formatForce'] = emmetConfig['preferences']['format.forceIndentationForTags'];
}
else if (typeof emmetConfig['preferences']['format.forceIndentationForTags'] === 'string') {
profile['formatForce'] = emmetConfig['preferences']['format.forceIndentationForTags'].split(',');
}
}
if (emmetConfig['preferences']['profile.allowCompactBoolean'] && typeof emmetConfig['preferences']['profile.allowCompactBoolean'] === 'boolean') {
profile['compactBooleanAttributes'] = emmetConfig['preferences']['profile.allowCompactBoolean'];
}
// Fetch Add Ons
let addons = {};
if (filter && filter.split(',').find(x => x.trim() === 'bem') || filtersFromProfile.indexOf('bem') > -1) {
addons['bem'] = { element: '__' };
if (emmetConfig['preferences']['bem.elementSeparator']) {
addons['bem']['element'] = emmetConfig['preferences']['bem.elementSeparator'];
}
if (emmetConfig['preferences']['bem.modifierSeparator']) {
addons['bem']['modifier'] = emmetConfig['preferences']['bem.modifierSeparator'];
}
}
let filtersFromProfile: string[] = (profile && profile['filters']) ? profile['filters'].split(',') : [];
filtersFromProfile = filtersFromProfile.map(filterFromProfile => filterFromProfile.trim());
// Update profile based on preferences
if (emmetConfig['preferences']['format.noIndentTags']) {
if (Array.isArray(emmetConfig['preferences']['format.noIndentTags'])) {
profile['formatSkip'] = emmetConfig['preferences']['format.noIndentTags'];
} else if (typeof emmetConfig['preferences']['format.noIndentTags'] === 'string') {
profile['formatSkip'] = emmetConfig['preferences']['format.noIndentTags'].split(',');
}
}
if (emmetConfig['preferences']['format.forceIndentationForTags']) {
if (Array.isArray(emmetConfig['preferences']['format.forceIndentationForTags'])) {
profile['formatForce'] = emmetConfig['preferences']['format.forceIndentationForTags'];
} else if (typeof emmetConfig['preferences']['format.forceIndentationForTags'] === 'string') {
profile['formatForce'] = emmetConfig['preferences']['format.forceIndentationForTags'].split(',');
}
}
if (emmetConfig['preferences']['profile.allowCompactBoolean'] && typeof emmetConfig['preferences']['profile.allowCompactBoolean'] === 'boolean') {
profile['compactBooleanAttributes'] = emmetConfig['preferences']['profile.allowCompactBoolean'];
}
// Fetch Add Ons
let addons = {};
if (filter && filter.split(',').find(x => x.trim() === 'bem') || filtersFromProfile.indexOf('bem') > -1) {
addons['bem'] = { element: '__' };
if (emmetConfig['preferences']['bem.elementSeparator']) {
addons['bem']['element'] = emmetConfig['preferences']['bem.elementSeparator'];
}
if (emmetConfig['preferences']['bem.modifierSeparator']) {
addons['bem']['modifier'] = emmetConfig['preferences']['bem.modifierSeparator'];
// Fetch Profile
let profile = getProfile(syntax, emmetConfig['syntaxProfiles']);
let filtersFromProfile: string[] = (profile && profile['filters']) ? profile['filters'].split(',') : [];
filtersFromProfile = filtersFromProfile.map(filterFromProfile => filterFromProfile.trim());
// Update profile based on preferences
if (emmetConfig['preferences']['format.noIndentTags']) {
if (Array.isArray(emmetConfig['preferences']['format.noIndentTags'])) {
profile['formatSkip'] = emmetConfig['preferences']['format.noIndentTags'];
} else if (typeof emmetConfig['preferences']['format.noIndentTags'] === 'string') {
profile['formatSkip'] = emmetConfig['preferences']['format.noIndentTags'].split(',');
}
}
if (emmetConfig['preferences']['format.forceIndentationForTags']) {
if (Array.isArray(emmetConfig['preferences']['format.forceIndentationForTags'])) {
profile['formatForce'] = emmetConfig['preferences']['format.forceIndentationForTags'];
} else if (typeof emmetConfig['preferences']['format.forceIndentationForTags'] === 'string') {
profile['formatForce'] = emmetConfig['preferences']['format.forceIndentationForTags'].split(',');
}
}
if (emmetConfig['preferences']['profile.allowCompactBoolean'] && typeof emmetConfig['preferences']['profile.allowCompactBoolean'] === 'boolean') {
profile['compactBooleanAttributes'] = emmetConfig['preferences']['profile.allowCompactBoolean'];
}
// Fetch Add Ons
let addons = {};
if (filter && filter.split(',').find(x => x.trim() === 'bem') || filtersFromProfile.indexOf('bem') > -1) {
addons['bem'] = { element: '__' };
if (emmetConfig['preferences']['bem.elementSeparator']) {
addons['bem']['element'] = emmetConfig['preferences']['bem.elementSeparator'];
}
}
// Fetch Profile
let profile = getProfile(syntax, emmetConfig['syntaxProfiles']);
let filtersFromProfile = (profile && profile['filters']) ? profile['filters'].split(',') : [];
filtersFromProfile = filtersFromProfile.map(filterFromProfile => filterFromProfile.trim());
// Update profile based on preferences
if (emmetConfig['preferences']['format.noIndentTags']) {
if (Array.isArray(emmetConfig['preferences']['format.noIndentTags'])) {
profile['formatSkip'] = emmetConfig['preferences']['format.noIndentTags'];
}
else if (typeof emmetConfig['preferences']['format.noIndentTags'] === 'string') {
profile['formatSkip'] = emmetConfig['preferences']['format.noIndentTags'].split(',');
}
}
if (emmetConfig['preferences']['format.forceIndentationForTags']) {
if (Array.isArray(emmetConfig['preferences']['format.forceIndentationForTags'])) {
profile['formatForce'] = emmetConfig['preferences']['format.forceIndentationForTags'];
}
else if (typeof emmetConfig['preferences']['format.forceIndentationForTags'] === 'string') {
profile['formatForce'] = emmetConfig['preferences']['format.forceIndentationForTags'].split(',');
}
}
if (emmetConfig['preferences']['profile.allowCompactBoolean'] && typeof emmetConfig['preferences']['profile.allowCompactBoolean'] === 'boolean') {
profile['compactBooleanAttributes'] = emmetConfig['preferences']['profile.allowCompactBoolean'];
}
// Fetch Add Ons
let addons = {};
if (filter && filter.split(',').find(x => x.trim() === 'bem') || filtersFromProfile.indexOf('bem') > -1) {
addons['bem'] = { element: '__' };
if (emmetConfig['preferences']['bem.elementSeparator']) {
addons['bem']['element'] = emmetConfig['preferences']['bem.elementSeparator'];
}
filtersFromProfile = filtersFromProfile.map(filterFromProfile => filterFromProfile.trim());
// Update profile based on preferences
if (emmetConfig['preferences']['format.noIndentTags']) {
if (Array.isArray(emmetConfig['preferences']['format.noIndentTags'])) {
profile['formatSkip'] = emmetConfig['preferences']['format.noIndentTags'];
} else if (typeof emmetConfig['preferences']['format.noIndentTags'] === 'string') {
profile['formatSkip'] = emmetConfig['preferences']['format.noIndentTags'].split(',');
}
}
if (emmetConfig['preferences']['format.forceIndentationForTags']) {
if (Array.isArray(emmetConfig['preferences']['format.forceIndentationForTags'])) {
profile['formatForce'] = emmetConfig['preferences']['format.forceIndentationForTags'];
} else if (typeof emmetConfig['preferences']['format.forceIndentationForTags'] === 'string') {
profile['formatForce'] = emmetConfig['preferences']['format.forceIndentationForTags'].split(',');
}
}
if (emmetConfig['preferences']['profile.allowCompactBoolean'] && typeof emmetConfig['preferences']['profile.allowCompactBoolean'] === 'boolean') {
profile['compactBooleanAttributes'] = emmetConfig['preferences']['profile.allowCompactBoolean'];
}
// Fetch Add Ons
let addons = {};
if (filter && filter.split(',').find(x => x.trim() === 'bem') || filtersFromProfile.indexOf('bem') > -1) {
addons['bem'] = { element: '__' };
if (emmetConfig['preferences']['bem.elementSeparator']) {
addons['bem']['element'] = emmetConfig['preferences']['bem.elementSeparator'];
}
if (emmetConfig['preferences']['bem.modifierSeparator']) {
addons['bem']['modifier'] = emmetConfig['preferences']['bem.modifierSeparator'];
}
let baseSyntax = isStyleSheet(syntax) ? 'css' : 'html';
if (!customSnippetRegistry[syntax] && customSnippetRegistry[baseSyntax]) {
customSnippetRegistry[syntax] = customSnippetRegistry[baseSyntax];
}
// Fetch Profile
let profile = getProfile(syntax, emmetConfig['syntaxProfiles']);
let filtersFromProfile: string[] = (profile && profile['filters']) ? profile['filters'].split(',') : [];
filtersFromProfile = filtersFromProfile.map(filterFromProfile => filterFromProfile.trim());
// Update profile based on preferences
if (emmetConfig['preferences']['format.noIndentTags']) {
if (Array.isArray(emmetConfig['preferences']['format.noIndentTags'])) {
profile['formatSkip'] = emmetConfig['preferences']['format.noIndentTags'];
} else if (typeof emmetConfig['preferences']['format.noIndentTags'] === 'string') {
profile['formatSkip'] = emmetConfig['preferences']['format.noIndentTags'].split(',');
}
}
if (emmetConfig['preferences']['format.forceIndentationForTags']) {
if (Array.isArray(emmetConfig['preferences']['format.forceIndentationForTags'])) {
profile['formatForce'] = emmetConfig['preferences']['format.forceIndentationForTags'];
} else if (typeof emmetConfig['preferences']['format.forceIndentationForTags'] === 'string') {
profile['formatForce'] = emmetConfig['preferences']['format.forceIndentationForTags'].split(',');
}
}
if (emmetConfig['preferences']['profile.allowCompactBoolean'] && typeof emmetConfig['preferences']['profile.allowCompactBoolean'] === 'boolean') {
profile['compactBooleanAttributes'] = emmetConfig['preferences']['profile.allowCompactBoolean'];
}
// Fetch Add Ons
let addons = {};