js-beautify: not correctly joining lines for HTML

This is really hurting me. Here is an example HTML file:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html>
<html lang="en-US" xmlns="http://www.w3.org/1999/xhtml">

<head>
    <title>Test Line Join</title>
</head>

<body>
    <p>The key words <q><span class="spec-must">must</span></q>, <q><span

          class="spec-must-not">must not</span></q>, <q><span class="spec-must">required</span></q>, <q><span

          class="spec-must">shall</span></q>, <q><span class="spec-must-not">shall not</span></q>, <q><span

          class="spec-should">should</span></q>, <q><span class="spec-should-not">should not</span></q>, <q><span

          class="spec-should">recommended</span></q>, <q><span class="spec-may">may</span></q>, and <q><span

          class="spec-may">optional</span></q> in this document are to be interpreted as described in <a href="#ref-rfc2119" class="ref">RFC 2119</a>.</p>
</body>

</html>

js-beautify should be getting rid of all that whitespace inside the <span …> tag. I want js-beautify to give me this:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html>
<html lang="en-US" xmlns="http://www.w3.org/1999/xhtml">

<head>
    <title>Test Line Join</title>
</head>

<body>
    <p>The key words <q><span class="spec-must">must</span></q>, <q><span class="spec-must-not">must not</span></q>, <q><span class="spec-must">required</span></q>, <q><span class="spec-must">shall</span></q>, <q><span class="spec-must-not">shall not</span></q>, <q><span class="spec-should">should</span></q>, <q><span class="spec-should-not">should not</span></q>, <q><span class="spec-should">recommended</span></q>, <q><span class="spec-may">may</span></q>, and <q><span class="spec-may">optional</span></q> in this document are to be interpreted as described in <a href="#ref-rfc2119" class="ref">RFC 2119</a>.</p>
</body>

</html>

But it doesn’t. This is a huge problem and is really dragging down the workflow. (The reason the lines are like that to begin with is a bug in BlueGriffon. So bugs in js-beautify are preventing it from fixing the bugs in BlueGriffon. Such is life.)

See #841.

Perhaps you could point me to a place in the code I might go to try to put in some workaround?

About this issue

  • Original URL
  • State: closed
  • Created 8 years ago
  • Comments: 26 (9 by maintainers)

Most upvoted comments

@garretwilson Thanks for the offer of compensation. I appreciate the thought. For me, much like @Glavin001, my main limitation is not money, but time.

What I need is people who can write code and tests that I don’t have to spend cycles debugging or fixing to join this project and contribute fixes. Until that happens, issues will continue to be addressed as I find time (that is to say, very slowly). Sorry, but that’s the reality.