syntaxProfiles.json
Output profiles are used to define how generated HTML content should look like. For example, when you expand br abbreviation, Emmet may produce one of the following tag:
<br>— HTML notation<br />— XHTML notation<br/>— XML notation
Emmet tries to automatically detect output profile for current document. For example, if a document contains XHTML doctype, it will use xhtml profile, html otherwise.
But sometimes you’d like to force Emmet to use another profile for specified syntax or use your own profile with specific rules.
In this case, you should create syntaxProfiles.json file in extensions folder and specify profile for a required syntax.
The content of this file is a simple key–value dictionary where the key is the syntax name as defined in snippets.json and the value is a name of predefined profile (String) or a dictionary with profile options (Object):
{
// force XHTML profile for HTML syntax
"html": "xhtml",
// create our own profile for XML
"xml": {
"tag_case": "upper",
"attr_quotes": "single"
}
}
Predefined profiles
html— default output profile.xhtml— the same ashtml, but outputs empty elements with closed slash:<br />.xml— default for XML and XSL syntaxes: outputs each tag on a new line with indentation, empty elements are outputted with closing slash:<br/>.line— used to output expanded abbreviation without any indentation and newlines. In some editors applies by default in programming languages like JavaScript or Python to produce valid strings.
Create your own profile
You can specify a dictionary with the following keys to create your own output profile:
tag_case: case of generated tag name, string. Possible values areupper,lowerandasis.attr_case: case of attribute names of generated tags, string. Possible values areupper,lowerandasis.attr_quotes: quotes around attribute values, string. Possible values aresingleanddouble.tag_nl: output each tag on new line with indentation, boolean. Values aretrue(each tag on new line),false(no formatting) and'decide'(string; only block-level elements on new lines).tag_nl_leaf: withtag_nlset totrue, defines whether leaf block-level node (e.g. node with no children) should have formatted line breaks inside.indent: indent tags on new lines, boolean.inline_break: how many inline elements are needed to force line break, number. The default value is3. For example,span*2will be expanded into<span></span><span></span>, butspan*3will create three<span>elements, each on a new line. Set this option to0to disable line breaks for inline elements.self_closing_tag: should empty elements—likebrorimg—be outputted with closing dash, boolean. Values aretrue,falseand'xhtml'(string; output closing slash in XHTML style, e.g.<br />).filters: list of filters to be applied automatically.