Skip to content

Fix indent level for externally formatted <script> inside control structure - #258

Merged
g-plane merged 1 commit into
g-plane:mainfrom
UnknownPlatypus:fix-control-structure-indent-hint
Sep 6, 2026
Merged

Fix indent level for externally formatted <script> inside control structure#258
g-plane merged 1 commit into
g-plane:mainfrom
UnknownPlatypus:fix-control-structure-indent-hint

Conversation

@UnknownPlatypus

Copy link
Copy Markdown
Contributor

The Doc was nested one level deeper but state.indent_level was left unchanged, so external formatters (in that case, script_formatter) received an undercounted indent hint for scripts inside control structure blocks.

So it was doing that when ran with any js external formater:

 {% if enabled %}
   <script>
-    document.addEventListener("DOMContentLoaded", () => {
-      console.log("nested");
-    });
+  document.addEventListener("DOMContentLoaded", () => {
+  console.log("nested");
+});
   </script>
 {% endif %}
  • The pull request description was written manually by me and was not generated by an AI tool or agent.
  • I have read and understood the relevant parts of the existing codebase before making these changes.
  • I have carefully reviewed and understood all code changes, and ensured that they match the style, architecture, and conventions of the existing codebase.
  • I understand that pull requests containing blindly generated or unreviewed AI-generated code may be closed without review.

The Doc was nested one level deeper but state.indent_level was left unchanged, so external formatters (script_formatter) received an undercounted indent hint for scripts inside control structure blocks.
@netlify

netlify Bot commented Aug 29, 2026

Copy link
Copy Markdown

Deploy Preview for markup-fmt ready!

Name Link
🔨 Latest commit e85b3eb
🔍 Latest deploy log https://app.netlify.com/projects/markup-fmt/deploys/6a930d8c638a360008a32dfa
😎 Deploy Preview https://deploy-preview-258--markup-fmt.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@g-plane
g-plane merged commit 6128861 into g-plane:main Sep 6, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants