Twig formatting now checks block structure before applying edits. Mismatched or incomplete blocks stay unchanged, and unknown custom tags and paired bodies preserve their original contents and indentation. Conditional HTML wrappers remain supported.
Verified with the shared regression suite, official Twig checks, Linux CI, and packaged extension tests on VS Code 1.85.2 and current stable. This is a structural parser; full Twig expression validation remains outside its scope.