Skip to content

Commit 1dc837e

Browse files
DerekNonGenericTrott
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: nodejs#33785 Reviewed-By: Rich Trott <[email protected]> Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Matteo Collina <[email protected]>
1 parent 1aa847f commit 1dc837e

File tree

5 files changed

+14
-12
lines changed

5 files changed

+14
-12
lines changed

doc/api/http.md

+5-5
Original file line numberDiff line numberDiff line change
@@ -2093,13 +2093,13 @@ added: v0.1.90
20932093

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

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

20992100
```http
2100-
GET /status?name=ryan HTTP/1.1\r\n
2101-
Accept: text/plain\r\n
2102-
\r\n
2101+
GET /status?name=ryan HTTP/1.1
2102+
Accept: text/plain
21032103
```
21042104

21052105
To parse the URL into its parts:

doc/api/http2.md

+5-5
Original file line numberDiff line numberDiff line change
@@ -3033,13 +3033,13 @@ added: v8.4.0
30333033

30343034
* {string}
30353035

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

30393040
```http
3040-
GET /status?name=ryan HTTP/1.1\r\n
3041-
Accept: text/plain\r\n
3042-
\r\n
3041+
GET /status?name=ryan HTTP/1.1
3042+
Accept: text/plain
30433043
```
30443044

30453045
Then `request.url` will be:

doc/api_assets/README.md

+2-1
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

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

doc/api_assets/hljs.css

+1
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)