Skip to content

JSON pretty printing inserts extra newline #349

@eproxus

Description

@eproxus

Compare:

$ xh get https://jsonplaceholder.typicode.com/todos/1
HTTP/2.0 200 OK
...headers...

{
    "userId": 1,
    "id": 1,
    "title": "delectus aut autem",
    "completed": false
}


$

With:

$ xh get google.com
HTTP/1.1 301 Moved Permanently
...headers...

<HTML><HEAD><meta http-equiv="content-type" content="text/html;charset=utf-8">
<TITLE>301 Moved</TITLE></HEAD><BODY>
<H1>301 Moved</H1>
The document has moved
<A HREF="http://www.google.com/">here</A>.
</BODY></HTML>

$

(Maybe the last newline should be stripped in the HTML case too?)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions