Skip to content

Indentation error for multi-line <py-script> blocks #104

@Zac-HD

Description

@Zac-HD

In the following example, pyscript is happy to automatically dedent one line, but only one line:

<html>
<head>
    <link rel="stylesheet" href="https://pyscript.net/alpha/pyscript.css" />
    <script defer src="https://pyscript.net/alpha/pyscript.js"></script>
</head>
<body>
    <h1>Demo of weird indentation error</h1>
    <div id="output"></div>
    <py-script output="output">
        print("Hello from indented line 1")
        print("Hello from indented line 2") # Comment out this line and it works
    </py-script>
</body>
</html>

Of course I can just fully-dedent all my code for now, but it would be nice if my editor's automatic indenting just worked 😄

Metadata

Metadata

Assignees

No one assigned

    Labels

    tag: interpreterRelated to the Python interpreter configurationtype: featureNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions