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

tidy moves vim modeline breaking it #1127

Open
konomikitten opened this issue Sep 11, 2024 · 0 comments
Open

tidy moves vim modeline breaking it #1127

konomikitten opened this issue Sep 11, 2024 · 0 comments

Comments

@konomikitten
Copy link

When I write html I add my vim modeline to the end of the file. For example

index.html

<!DOCTYPE html>
<html>
	<head>
		<title>Title</title>
		<meta charset="UTF-8">
		<meta name="viewport" content="width=device-width, initial-scale=1"/>
		<meta name="color-scheme" content="dark light">
	</head>
	<body>
		<p>This is a test</p>
	</body>
</html>

<!-- vim: set tabstop=2 shiftwidth=2 softtabstop=2 noexpandtab: -->

Using tidy on this snippet breaks it though by moving the vim line into the body:

tidy --indent yes --wrap 78 --tidy-mark no index.html

<!DOCTYPE html>
<html>
  <head>
    <title>
      Title
    </title>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta name="color-scheme" content="dark light">
  </head>
  <body>
    <p>
      This is a test
    </p><!-- vim: set tabstop=2 shiftwidth=2 softtabstop=2 noexpandtab: -->
  </body>
</html>

I have checked the parameters for tidy and I can't find anyway to stop it moving my comment. Thoughts?

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

1 participant