Skip to content

Commit 795b892

Browse files
committed
Add (just barely) multipart support
1 parent d954b95 commit 795b892

File tree

1 file changed

+25
-0
lines changed

1 file changed

+25
-0
lines changed

scripts/md2html/md2html.js

+25
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,31 @@ hljs.registerLanguage('uri', function() {
4848
],
4949
}
5050
});
51+
hljs.registerLanguage('multipart', function() {
52+
return {
53+
// This is a very limited approach that only
54+
// detects boundaries and headers that start
55+
// with "Content-"
56+
contains: [
57+
{
58+
scope: "meta",
59+
match: /^--.*$/,
60+
},
61+
{
62+
scope: "literal",
63+
begin: /^Content-/,
64+
end: /$/,
65+
contains: [
66+
{
67+
scope: "attr",
68+
begin: " ",
69+
end: /$/,
70+
},
71+
]
72+
},
73+
],
74+
}
75+
});
5176
hljs.registerLanguage('eventstream', function() {
5277
return {
5378
contains: [

0 commit comments

Comments
 (0)