Skip to content

Commit

Permalink
use more regex
Browse files Browse the repository at this point in the history
  • Loading branch information
joshgoebel committed Oct 31, 2020
1 parent ca7a2d0 commit 8da4e3e
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/languages/http.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,12 +38,12 @@ export default function(hljs) {
return {
name: 'HTTP',
aliases: ['https'],
illegal: '\\S',
illegal: /\S/,
contains: [
// response
{
begin: '^(?=' + VERSION + " \\d{3})",
end: '$',
end: /$/,
contains: [
{
className: "meta",
Expand All @@ -55,13 +55,14 @@ export default function(hljs) {
],
starts: {
end: /\b\B/,
illegal: '\\S',
illegal: /\S/,
contains: HEADERS_AND_BODY
}
},
// request
{
begin: '(?=^[A-Z]+ (.*?) ' + VERSION + '$)',
end: /$/,
contains: [
{
className: 'string',
Expand All @@ -79,10 +80,9 @@ export default function(hljs) {
begin: '[A-Z]+'
}
],
end: /$/,
starts: {
end: /\b\B/,
illegal: '\\S',
illegal: /\S/,
contains: HEADERS_AND_BODY
}
}
Expand Down

0 comments on commit 8da4e3e

Please sign in to comment.