Skip to content
New issue

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

embedded javascript is not being indented, nor is existing indentation preserved #1111

Open
bjsassone opened this issue Apr 17, 2024 · 1 comment

Comments

@bjsassone
Copy link

Embedded javascript is not being indented, nor is existing indentation being preserved.

Cmd:

tidy --indent --indent-spaces 4

Input:

<!DOCTYPE html>
<html>
<head><title>title</title></head>
<body>
<script type="text/javascript">
function() {
    indent;
}
function() {
    indent;
}
</script>
</body>
</html>

Output:

<!DOCTYPE html>
<html>
<head>
    <meta name="generator" content="HTML Tidy for HTML5 for Linux version 5.6.0">
    <title>title</title>
</head>
<body>
    <script type="text/javascript">
    function() {
    indent;
    }
    function() {
    indent;
    }
    </script>
</body>
</html>
@stellarpower
Copy link

Personally, I'd like the indentation of scripts and styles to be preserved within those blocks, but, also ensure that they are indented within the tags. So in essence, ensure four spaces from the start of the <script> tag for each line; then don't touch anything after that, would be ideal.

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

No branches or pull requests

2 participants