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

Strip tags after update to 0.1.2 #6

Closed
mrmlnc opened this issue Mar 3, 2016 · 4 comments
Closed

Strip tags after update to 0.1.2 #6

mrmlnc opened this issue Mar 3, 2016 · 4 comments

Comments

@mrmlnc
Copy link
Member

mrmlnc commented Mar 3, 2016

Minimal test:

var fs = require('fs');
var parse = require('posthtml-parser');
var render = require('posthtml-render');

var file = fs.readFileSync('in.html');
var raw = parse(file);
var html = render(raw);

fs.writeFileSync('out.html', html);

Before update:

<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <title>Document</title>
</head>
<body>
  <input autofocus type="text" class="class" name="name" id="id" required>
</body>
</html>

After update:

<html lang="en">
<head>
  <meta charset="UTF-8"></head>
<body>
  <input autofocus="" type="text" class="class" name="name" id="id" required=""></body>
</html>

If disable XMLMode.

<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <title>Document</title>
</head>
<body>
  <input autofocus="" type="text" class="class" name="name" id="id" required="">
</body>
</html>
@voischev
Copy link
Member

voischev commented Mar 3, 2016

More case? Maybe you create tests for this?

@mrmlnc
Copy link
Member Author

mrmlnc commented Mar 3, 2016

it('should be parse doctype in uppercase', function() {
    expect(parser('<!DOCTYPE html>')).to.eql(['<!DOCTYPE html>']);
});
AssertionError: expected [] to deeply equal [ '<!DOCTYPE html>' ]
actual expected                                                  

[][                                                              
  "<!DOCTYPE html>"                                              
]                                                                

@voischev
Copy link
Member

voischev commented Mar 3, 2016

@gitscrum
/cc

@Scrum
Copy link
Member

Scrum commented Mar 3, 2016

@voischev ups )) see PR #7

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

3 participants