We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Similar to the html support in vscode, hitting enter in a xml tag should automatically indent the content.
enter
No idea how it's implemented in the html extension. It's probably a client-side feature, but not necessarily.
The text was updated successfully, but these errors were encountered:
Found the idea in https://stackoverflow.com/questions/51235400/visual-studio-code-auto-close-tag-and-indent-xml-as-with-html
Sorry, something went wrong.
In the html extension, this is achieved via those dreadful regexp patterns:
languages.setLanguageConfiguration('html', { indentationRules: { increaseIndentPattern: /<(?!\?|(?:area|base|br|col|frame|hr|html|img|input|link|meta|param)\b|[^>]*\/>)([-_\.A-Za-z0-9]+)(?=\s|>)\b[^>]*>(?!.*<\/\1>)|<!--(?!.*-->)|\{[^}"']*$/, decreaseIndentPattern: /^\s*(<\/(?!html)[-_\.A-Za-z0-9]+\b[^>]*>|-->|\})/ }, wordPattern: /(-?\d*\.\d\w*)|([^\`\~\!\@\$\^\&\*\(\)\=\+\[\{\]\}\\\|\;\:\'\"\,\.\<\>\/\s]+)/g, onEnterRules: [ { beforeText: new RegExp(`<(?!(?:${EMPTY_ELEMENTS.join('|')}))([_:\\w][_:\\w-.\\d]*)([^/>]*(?!/)>)[^<]*$`, 'i'), afterText: /^<\/([_:\w][_:\w-.\d]*)\s*>/i, action: { indentAction: IndentAction.IndentOutdent } }, { beforeText: new RegExp(`<(?!(?:${EMPTY_ELEMENTS.join('|')}))(\\w[\\w\\d]*)([^/>]*(?!/)>)[^<]*$`, 'i'), action: { indentAction: IndentAction.Indent } } ], });
/me needs to throw up
Got a fix. Will PR after I get some shut eye.
Tadaaaa
fbricon
No branches or pull requests
Similar to the html support in vscode, hitting
enter
in a xml tag should automatically indent the content.No idea how it's implemented in the html extension. It's probably a client-side feature, but not necessarily.
The text was updated successfully, but these errors were encountered: