Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
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 = {};
emmetConfig['preferences'] = emmetConfig['preferences'] || {};
// Fetch snippet registry
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 snippet registry
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
function getExpandOptions(syntax, emmetConfig, filter) {
emmetConfig = emmetConfig || {};
emmetConfig['preferences'] = emmetConfig['preferences'] || {};
// Fetch snippet registry
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 = (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'];
emmetConfig['preferences'] = emmetConfig['preferences'] || {};
// Fetch snippet registry
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 = (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 = {};
emmetConfig = emmetConfig || {};
emmetConfig['preferences'] = emmetConfig['preferences'] || {};
// Fetch snippet registry
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 snippet registry
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 = (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) {
function getExpandOptions(syntax, emmetConfig, filter) {
emmetConfig = emmetConfig || {};
emmetConfig['preferences'] = emmetConfig['preferences'] || {};
// Fetch snippet registry
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 = (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'];
}