This one maybe better:
| Status | Response |
| ------ | --------- |
| 200 |<pre lang="json">{<br> "id": 10,<br> "username": "alanpartridge",<br> "email": "alan@alan.com",<br> "password_hash": "$2a$10$uhUIUmVWVnrBWx9rrDWhS.CPCWCZsyqqa8./whhfzBZydX7yvahHS",<br> "password_salt": "$2a$10$uhUIUmVWVnrBWx9rrDWhS.",<br> "created_at": "2015-02-14T20:45:26.433Z",<br> "updated_at": "2015-02-14T20:45:26.540Z"<br>}</pre>|
| 400 |<code>{<br> "code": 400,<br> "msg": balabala"<br>}</code>|
Both of them need the <br>
, it depends on you like the <pre>
or <code>
.
In stackoverflow, the above displays as:
Status |
Response |
200 |
{ "id": 10, "username": "alanpartridge", "email": "alan@alan.com", "password_hash": "$2a$10$uhUIUmVWVnrBWx9rrDWhS.CPCWCZsyqqa8./whhfzBZydX7yvahHS", "password_salt": "$2a$10$uhUIUmVWVnrBWx9rrDWhS.", "created_at": "2015-02-14T20:45:26.433Z", "updated_at": "2015-02-14T20:45:26.540Z" } |
400 |
{ "code": 400, "msg": balabala" } |
Which doesn't display the <pre lang="json">
block as code.
However, in stackoverflow, removing the lang="json"
from <pre>
does display the entire <pre>
block as a code block. That is:
| Status | Response |
| ------ | --------- |
| 200 |<pre>{<br> "id": 10,<br> "username": "alanpartridge",<br> "email": "alan@alan.com",<br> "password_hash": "$2a$10$uhUIUmVWVnrBWx9rrDWhS.CPCWCZsyqqa8./whhfzBZydX7yvahHS",<br> "password_salt": "$2a$10$uhUIUmVWVnrBWx9rrDWhS.",<br> "created_at": "2015-02-14T20:45:26.433Z",<br> "updated_at": "2015-02-14T20:45:26.540Z"<br>}</pre>|
| 400 |<code>{<br> "code": 400,<br> "msg": balabala"<br>}</code>|
displays as:
Status |
Response |
200 |
{ "id": 10, "username": "alanpartridge", "email": "alan@alan.com", "password_hash": "$2a$10$uhUIUmVWVnrBWx9rrDWhS.CPCWCZsyqqa8./whhfzBZydX7yvahHS", "password_salt": "$2a$10$uhUIUmVWVnrBWx9rrDWhS.", "created_at": "2015-02-14T20:45:26.433Z", "updated_at": "2015-02-14T20:45:26.540Z" } |
400 |
{ "code": 400, "msg": balabala" } |