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 <rtrott@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
  • Loading branch information
Derek Lewis authored and MylesBorins committed Jul 16, 2020
1 parent 26ecdf8 commit af9e6f6
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 @@ -2090,13 +2090,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 @@ -3027,13 +3027,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 af9e6f6

Please sign in to comment.