Skip to content

Commit e2fff1b

Browse files
Derek Lewisaddaleax
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 19bfc01 commit e2fff1b

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
@@ -1982,13 +1982,13 @@ added: v0.1.90
19821982

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

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

19881989
```http
1989-
GET /status?name=ryan HTTP/1.1\r\n
1990-
Accept: text/plain\r\n
1991-
\r\n
1990+
GET /status?name=ryan HTTP/1.1
1991+
Accept: text/plain
19921992
```
19931993

19941994
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
@@ -2987,13 +2987,13 @@ added: v8.4.0
29872987

29882988
* {string}
29892989

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

29932994
```http
2994-
GET /status?name=ryan HTTP/1.1\r\n
2995-
Accept: text/plain\r\n
2996-
\r\n
2995+
GET /status?name=ryan HTTP/1.1
2996+
Accept: text/plain
29972997
```
29982998

29992999
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)