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

[Bug] Line breaks in tags #6

Open
Kristinita opened this issue Jan 11, 2018 · 2 comments
Open

[Bug] Line breaks in tags #6

Kristinita opened this issue Jan 11, 2018 · 2 comments

Comments

@Kristinita
Copy link

1. Summary

I get line breaks in output, if I use grunt-htmltidy. I don't get them, if I use HTML-Tidy CLI.

2. Environment

  • Windows 10 Enterprise LTSB 64-bit EN,
  • HTML Tidy for Windows version 5.4.0,
  • Grunt 1.0.1,
  • grunt-htmltidy 0.2.2.

3. Configuration

My DebugGruntTidy.html file:

<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="utf-8">
    <title>Debugging Grunt Tidy</title>
    <script src="//cdn.jsdelivr.net/jquery/3.2.1/jquery.min.js"></script>
  </head>
  <body>
    Sasha Tidy
  </body>
</html>

My tidy-config.txt file:

wrap: 0

Part of my Gruntfile.coffee file:

   htmltidy:
        options:
          # indent: yes
          # Disable line breaks
          # https://stackoverflow.com/a/7681425/5951529
          wrap: 0
          # 'vertical-space': no
        debug:
          files: [
            expand: true
            cwd: 'output/Debug'
            src: '**/*.html'
            dest: 'output/Debug'
          ]

  grunt.registerTask 'test', [
  'htmltidy'
  ]

4. Expected behavior

If I use HTML-Tidy CLI:

tidy -config tidy-config.txt -m DebugGruntTidy.html
<!DOCTYPE html>
<html lang="en">
<head>
<meta name="generator" content="HTML Tidy for HTML5 for Windows version 5.4.0">
<meta charset="utf-8">
<title>Debugging Grunt Tidy</title>

<script src="//cdn.jsdelivr.net/jquery/3.2.1/jquery.min.js"></script>
</head>
<body>
Sasha Tidy
</body>
</html>

5. Actual behavior

If I use grunt-htmltidy:

grunt test
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Debugging Grunt Tidy</title>

<script src="//cdn.jsdelivr.net/jquery/3.2.1/jquery.min.js">
</script>
</head>
<body>
Sasha Tidy
</body>
</html>

<\script> in a new line.

New line

6. Not helped

  1. I try to use 'vertical-space': no and indent: yes in Gruntfile.coffee.
  2. grunt-jsbeautifier not fix this problem.

Thanks.

@Kristinita
Copy link
Author

@gavinballard , ping.

@gavinballard
Copy link
Owner

Hey @Kristinita, apologies for the delayed response. I haven't been able to find a clear cause of the issue I'm afraid. I don't have a lot of time to dig into this library any more - if a fix can be found I'm happy to review, merge and release an updated package version.

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