@@ -48,22 +48,99 @@ hljs.registerLanguage('uri', function() {
48
48
] ,
49
49
}
50
50
} ) ;
51
- hljs . registerLanguage ( 'eventstream ' , function ( ) {
51
+ hljs . registerLanguage ( 'multipart ' , function ( ) {
52
52
return {
53
+ // This is a very limited approach that only
54
+ // detects boundaries and headers that start
55
+ // with "Content-"
53
56
contains : [
54
57
{
55
- scope : "attr" ,
56
- begin : / ^ / ,
57
- end : ":" ,
58
+ scope : "meta" ,
59
+ match : / ^ - - .* $ / ,
58
60
} ,
59
61
{
60
62
scope : "literal" ,
61
- begin : / : * / ,
63
+ begin : / ^ C o n t e n t - / ,
64
+ end : / $ / ,
65
+ contains : [
66
+ {
67
+ scope : "attr" ,
68
+ begin : " " ,
69
+ end : / $ / ,
70
+ } ,
71
+ ]
72
+ } ,
73
+ ] ,
74
+ }
75
+ } ) ;
76
+ hljs . registerLanguage ( 'eventstream' , function ( ) {
77
+ return {
78
+ contains : [
79
+ {
80
+ scope : "comment" ,
81
+ begin : / ^ : / ,
62
82
end : / $ / ,
63
83
} ,
84
+ {
85
+ scope : "attr" ,
86
+ match : / ^ [ ^ : ] + /
87
+ } ,
64
88
] ,
65
89
}
66
90
} ) ;
91
+ hljs . registerLanguage ( 'jsonseq' , function ( ) {
92
+ return {
93
+ keywords : [ "true" , "false" , "null" ] ,
94
+ contains : [
95
+ {
96
+ scope : "meta" ,
97
+ match : / 0 [ x X ] 1 [ e E ] / ,
98
+ } ,
99
+ {
100
+ scope : "attr" ,
101
+ begin : / " ( \\ .| [ ^ \\ " \r \n ] ) * " (? = \s * : ) / ,
102
+ relevance : 1.01
103
+ } ,
104
+ {
105
+ scope : "punctuation" ,
106
+ match : / [ { } [ \] , : ] / ,
107
+ relevance : 0
108
+ } ,
109
+ {
110
+ scope : "literals" ,
111
+ beginKeywords : [ "true" , "false" , "null" ] . join ( " " ) ,
112
+ } ,
113
+ hljs . QUOTE_STRING_MODE ,
114
+ hljs . C_NUMBER_MODE
115
+ ]
116
+ }
117
+ } ) ;
118
+ hljs . registerLanguage ( 'jsonl' , function ( ) {
119
+ return {
120
+ aliases : [ "ndjson" ] ,
121
+ keywords : [ "true" , "false" , "null" ] ,
122
+ contains : [
123
+ {
124
+ scope : 'attr' ,
125
+ begin : / " ( \\ .| [ ^ \\ " \r \n ] ) * " (? = \s * : ) / ,
126
+ relevance : 1.01
127
+ } ,
128
+ {
129
+ scope : "punctuation" ,
130
+ match : / [ { } [ \] , : ] / ,
131
+ relevance : 0
132
+ } ,
133
+ {
134
+ scope : "literals" ,
135
+ beginKeywords : [ "true" , "false" , "null" ] . join ( " " ) ,
136
+ } ,
137
+ hljs . QUOTE_STRING_MODE ,
138
+ hljs . C_NUMBER_MODE
139
+ ]
140
+ }
141
+ } ) ;
142
+
143
+
67
144
const cheerio = require ( 'cheerio' ) ;
68
145
69
146
let argv = require ( 'yargs' )
0 commit comments