@@ -224,36 +224,37 @@ templates._reduce_tokens = function(context, token, index)
224224{
225225 var TYPE = 0 ;
226226 var STR = 1 ;
227- var attrs = [ "class" , cls . HTTPHeaderTokenizer . classnames [ token [ TYPE ] ] ] ;
228-
229227 if ( HIGHLIGHTED_TYPES . contains ( token [ TYPE ] ) )
230228 {
229+ var token_templ = [ "span" , token [ STR ] ,
230+ "class" , cls . HTTPHeaderTokenizer . classnames [ token [ TYPE ] ] ] ;
231231 if ( token [ TYPE ] === cls . HTTPHeaderTokenizer . types . NAME )
232232 {
233- attrs . push ( "data-spec" , "http#" + token [ STR ] . trim ( ) ) ;
233+ token_templ . push ( "data-spec" , "http#" + token [ STR ] . trim ( ) ) ;
234234 }
235235 else if ( token [ TYPE ] === cls . HTTPHeaderTokenizer . types . FIRST_LINE_PART )
236236 {
237237 if ( context . spec_tokens . contains ( context . saw_firstline_tokens ) )
238238 {
239- attrs . push ( "data-spec" , "http#" + ( token [ STR ] ) . trim ( ) ) ;
239+ token_templ . push ( "data-spec" , "http#" + ( token [ STR ] ) . trim ( ) ) ;
240240 }
241241 context . saw_firstline_tokens ++ ;
242242 }
243+
243244 if ( context . str_buffer )
244245 {
245246 context . template . push ( context . str_buffer ) ;
246247 context . str_buffer = "" ;
247248 }
248- context . template . push ( [ "span" , token [ STR ] ] . extend ( attrs ) ) ;
249+ context . template . push ( token_templ ) ;
249250 }
250251 else
251252 context . str_buffer += token [ STR ] ;
252253
253254 return context ;
254255} ;
255256
256- templates . _token_to_template_context = function ( is_response )
257+ templates . TokenToTemplateContext = function ( is_response )
257258{
258259 var spec_tokens ;
259260 if ( ! is_response )
@@ -274,7 +275,7 @@ templates._token_to_template_context = function(is_response)
274275
275276templates . headers_tonkenized = function ( tokens , is_response )
276277{
277- var context = new templates . _token_to_template_context ( is_response ) ;
278+ var context = new templates . TokenToTemplateContext ( is_response ) ;
278279 var template = tokens . reduce ( this . _reduce_tokens , context ) . template ;
279280 if ( context . str_buffer )
280281 template . push ( context . str_buffer ) ;
0 commit comments