Skip to content

Commit

Permalink
Fix auto-indenting in XML
Browse files Browse the repository at this point in the history
  • Loading branch information
FIameCaster committed May 2, 2024
1 parent 616b7f7 commit ab15799
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions package/src/languages/shared/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { getClosestToken, getLineBefore } from "../../utils"
const clikeIndent = /[([{][^)\]}]*$|^[^.]*\b(?:case .+?|default):\s*$/,
isBracketPair = /\[]|\(\)|{}/,
xmlOpeningTag =
/<(?![!\d#@])([^\s/=>$<%]+)(?:\s(?:\s*[^\s/"'=>]+(?:\s*=\s*(?!\s)(?:"[^"]*"|'[^']*'|[^\s"'=>]+(?=[\s>]))?|(?=[\s/>])))+)?\s*>[ \t]*$/,
/<(?![?!\d#@])([^\s/=>$<%]+)(?:\s(?:\s*[^\s/"'=>]+(?:\s*=\s*(?!\s)(?:"[^"]*"|'[^']*'|[^\s"'=>]+(?=[\s>]))?|(?=[\s/>])))+)?\s*>[ \t]*$/,
xmlClosingTag = /^<\/(?!\d)[^\s/=>$<%]+\s*>/,
openBracket = /[([{][^)\]}]*$/

Expand Down Expand Up @@ -38,7 +38,7 @@ const markupComment: CommentTokens = {

const markupLanguage = (
comment = markupComment,
tagPattern = xmlClosingTag,
tagPattern = xmlOpeningTag,
voidTags?: RegExp,
): Language => ({
comments: comment,
Expand Down

0 comments on commit ab15799

Please # to comment.