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

Mangled HTML tags with command line/python library #1136

Closed
jbeukelman opened this issue Feb 16, 2017 · 1 comment
Closed

Mangled HTML tags with command line/python library #1136

jbeukelman opened this issue Feb 16, 2017 · 1 comment

Comments

@jbeukelman
Copy link

Description

When using the command line js-beautifier or python library, HTML tags get mangled. newlines are created immediately after the HTML opening tag. Strange.
This does not happen when pasting into the box on www.jsbeautifier.org website.

Input

The code looked like this before beautification:
snippet below taken from www.example.com

<!doctype html>
<html>
<head>
    <title>Example Domain</title>

    <meta charset="utf-8" />
    <meta http-equiv="Content-type" content="text/html; charset=utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1" />
    <style type="text/css">
    body {
        background-color: #f0f0f2;

Actual Output

The code actually looked like this after beautification:

< !doctype html >
    <
    html >
    <
    head >
    <
    title > Example Domain < /title>

<
meta charset = "utf-8" / >
    <
    meta http - equiv = "Content-type"
content = "text/html; charset=utf-8" / >
    <
    meta name = "viewport"
content = "width=device-width, initial-scale=1" / >
    <
    style type = "text/css" >
    body {
        background - color: # f0f0f2;

Steps to Reproduce

1- go to www.example.com
2- view source and copy to local file.
3- run js-beautifier

Environment

OS: Linuxmint 17.3 with python 2.7.6. have also tried a debian stretch machine with python 2.7.13 with the same result. both with jsbeautifier 1.6.9

@bitwiseman
Copy link
Member

bitwiseman commented Feb 17, 2017

There is not python version of the html beautifier, sorry. See #205.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants