Skip to content

Commit af9e6f6

Browse files
Derek LewisMylesBorins
Derek Lewis
authored andcommitted
doc: add http highlight grammar
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]>
1 parent 26ecdf8 commit af9e6f6

File tree

5 files changed

+14
-12
lines changed

5 files changed

+14
-12
lines changed

doc/api/http.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2090,13 +2090,13 @@ added: v0.1.90
20902090

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

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

20962097
```http
2097-
GET /status?name=ryan HTTP/1.1\r\n
2098-
Accept: text/plain\r\n
2099-
\r\n
2098+
GET /status?name=ryan HTTP/1.1
2099+
Accept: text/plain
21002100
```
21012101

21022102
To parse the URL into its parts:

doc/api/http2.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3027,13 +3027,13 @@ added: v8.4.0
30273027

30283028
* {string}
30293029

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

30333034
```http
3034-
GET /status?name=ryan HTTP/1.1\r\n
3035-
Accept: text/plain\r\n
3036-
\r\n
3035+
GET /status?name=ryan HTTP/1.1
3036+
Accept: text/plain
30373037
```
30383038

30393039
Then `request.url` will be:

doc/api_assets/README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,15 @@
22

33
## highlight.pack.js
44

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

77
Grammars included in the custom bundle:
88

99
* Bash
1010
* C
1111
* C++
1212
* CoffeeScript
13+
* HTTP
1314
* JavaScript
1415
* JSON
1516
* Markdown

doc/api_assets/highlight.pack.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

doc/api_assets/hljs.css

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
color: #333;
88
}
99

10+
.hljs-attribute,
1011
.hljs-keyword {
1112
color: #338;
1213
}

0 commit comments

Comments
 (0)