Skip to content

Commit

Permalink
Initial implementation of HTTP response language.
Browse files Browse the repository at this point in the history
  • Loading branch information
isagalaev committed Apr 23, 2012
1 parent 3971b57 commit 1ce7eae
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 0 deletions.
30 changes: 30 additions & 0 deletions src/languages/http.js
@@ -0,0 +1,30 @@
/*
Language: HTTP
*/
hljs.LANGUAGES.http = {
defaultMode: {
illegal: '.',
contains: [
{
className: 'title',
begin: '^HTTP/[0-9\\.]+', end: '$',
starts: {
end: '\\n\\n',
contains: [
{
className: 'key',
begin: '^\\w', end: ': ', excludeEnd: true,
starts: {
className: 'value', end: '$'
}
}
],
starts: {
end: hljs.EOF_RE,
subLanguage: ''
}
}
}
]
}
}
11 changes: 11 additions & 0 deletions src/test.html
Expand Up @@ -643,6 +643,17 @@ <h2>Automatically detected languages</h2>
end if
next</code></pre>

<tr>
<th>HTTP
<td class="http">
<pre><code>HTTP/1.1 200 OK
Server: Apache-Coyote/1.1
Date: Sat, 14 Apr 2012 18:01:56 GMT
Content-Type: application/vnd-riv.crm.scheduling.v1_1+json; charset=UTF-8
Content-Length: 1405

&lt;xml&gt;&lt;/xml&gt;</code></pre>

<tr>
<th>Lua
<td class="lua">
Expand Down

0 comments on commit 1ce7eae

Please sign in to comment.