Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions scripts/md2html/md2html.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,22 @@ hljs.registerLanguage('uri', function() {
],
}
});
hljs.registerLanguage('eventstream', function() {
return {
contains: [
{
scope: "attr",
begin: /^/,
end: ":",
},
{
scope: "literal",
begin: /: */,
end: /$/,
},
],
}
});
const cheerio = require('cheerio');

let argv = require('yargs')
Expand Down
8 changes: 8 additions & 0 deletions tests/md2html/fixtures/basic-new.html
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,14 @@
</code></pre>
<pre class="nohighlight" tabindex="0"><code>https://foo.com/bar{<span class="hljs-attr">?baz*</span>,<span class="hljs-attr">qux</span>}
</code></pre>
<pre class="nohighlight" tabindex="0"><code><span class="hljs-attr">data:</span> This data is formatted
<span class="hljs-attr">data:</span> across two lines
<span class="hljs-attr">retry:</span> 5
<span class="hljs-attr">
event:</span> add
<span class="hljs-attr">data:</span> 1234.5678
<span class="hljs-attr">unknown-field:</span> this is ignored
<span class="hljs-attr"></span></code></pre>
</section></section><section class="appendix"><h1>Appendix A: Revision History</h1>
<table>
<thead>
Expand Down
10 changes: 10 additions & 0 deletions tests/md2html/fixtures/basic-new.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,16 @@ https://foo.com/bar?baz=qux&fred=waldo#fragment
https://foo.com/bar{?baz*,qux}
```

```eventstream
data: This data is formatted
data: across two lines
retry: 5

event: add
data: 1234.5678
unknown-field: this is ignored
```

## Appendix A: Revision History

Version | Date
Expand Down