Skip to content

Commit

Permalink
doc: add http highlight grammar
Browse files Browse the repository at this point in the history
Prior to this commit, http request message code blocks in Markdown
files were not being highlighted correctly. This has been corrected by
adding the new grammar to the bundle, removing the CRLFs (`\r\n`) from
these code samples, adding a reminder to re-add them, and tuning the
syntax theme to support attribute highlighting.

PR-URL: #33785
Reviewed-By: Rich Trott <[email protected]>
Reviewed-By: Luigi Pinca <[email protected]>
Reviewed-By: Matteo Collina <[email protected]>
  • Loading branch information
Derek Lewis authored and addaleax committed Sep 22, 2020
1 parent 19bfc01 commit e2fff1b
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 12 deletions.
10 changes: 5 additions & 5 deletions doc/api/http.md
Original file line number Diff line number Diff line change
Expand Up @@ -1982,13 +1982,13 @@ added: v0.1.90

**Only valid for request obtained from [`http.Server`][].**

Request URL string. This contains only the URL that is
present in the actual HTTP request. If the request is:
Request URL string. This contains only the URL that is present in the actual
HTTP request. If the request is (remember, each header line ends with `\r\n`
plus a final `\r\n` after the last one indicating the end of the header):

```http
GET /status?name=ryan HTTP/1.1\r\n
Accept: text/plain\r\n
\r\n
GET /status?name=ryan HTTP/1.1
Accept: text/plain
```

To parse the URL into its parts:
Expand Down
10 changes: 5 additions & 5 deletions doc/api/http2.md
Original file line number Diff line number Diff line change
Expand Up @@ -2987,13 +2987,13 @@ added: v8.4.0

* {string}

Request URL string. This contains only the URL that is
present in the actual HTTP request. If the request is:
Request URL string. This contains only the URL that is present in the actual
HTTP request. If the request is (remember, each header line ends with `\r\n`
plus a final `\r\n` after the last one indicating the end of the header):

```http
GET /status?name=ryan HTTP/1.1\r\n
Accept: text/plain\r\n
\r\n
GET /status?name=ryan HTTP/1.1
Accept: text/plain
```

Then `request.url` will be:
Expand Down
3 changes: 2 additions & 1 deletion doc/api_assets/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,15 @@

## highlight.pack.js

_Generated by [highlightjs.org/download][] on 2020-05-16._
_Generated by [highlightjs.org/download][] on 2020-06-07._

Grammars included in the custom bundle:

* Bash
* C
* C++
* CoffeeScript
* HTTP
* JavaScript
* JSON
* Markdown
Expand Down
2 changes: 1 addition & 1 deletion doc/api_assets/highlight.pack.js

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions doc/api_assets/hljs.css
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
color: #333;
}

.hljs-attribute,
.hljs-keyword {
color: #338;
}
Expand Down

0 comments on commit e2fff1b

Please sign in to comment.