这个可能更好:
| 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>|
两者都需要<br>
,就看你喜欢<pre>
还是<code>
。
在stackoverflow中,上面显示为:
地位 |
回复 |
200 |
{ “id”:10, “用户名”:“alanpartridge”, “电子邮件”:“alan@alan.com”, “password_hash”:“$2a$10$uhUIUmVWVnrBWx9rrDWhS.CPCWCZsyqqa8./whhfzBZydX7yvahHS”, “password_salt”:“$2 a$10$uhUIUmVWVnrBWx9rrDWhS.", "created_at": "2015-02-14T20:45:26.433Z", "updated_at": "2015-02-14T20:45:26.540Z" } |
400 |
{ "code": 400, "msg": balabala" } |
这不会将<pre lang="json">
块显示为代码。
但是,在 stackoverflow 中,删除lang="json"
from<pre>
确实会将整个<pre>
块显示为代码块。那是:
| 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>|
显示为:
地位 |
回复 |
200 |
{ “id”:10, “用户名”:“alanpartridge”, “电子邮件”:“alan@alan.com”, “password_hash”:“$2a$10$uhUIUmVWVnrBWx9rrDWhS.CPCWCZsyqqa8./whhfzBZydX7yvahHS”, “password_salt”:“$2 a$10$uhUIUmVWVnrBWx9rrDWhS.", "created_at": "2015-02-14T20:45:26.433Z", "updated_at": "2015-02-14T20:45:26.540Z" } |
400 |
{ "code": 400, "msg": balabala" } |