@@ -54,16 +54,26 @@ <h1>Recombine Tags And Decorations Test</h1>
5454 // td.actual
5555 var actual = testResult . nextSibling ;
5656 while ( actual . nodeType !== 1 ) { actual = actual . nextSibling ; }
57- // make a copy of input node (modified in-place)
58- var clone = testInput . cloneNode ( true ) ;
59- clone . className = '' ; // IE
60- clone . removeAttribute ( 'class' ) ; // Not IE.
61- actual . appendChild ( clone ) ;
62- // run function
63- var isPreformatted = / p r e | x m p / i. test ( clone . tagName ) ;
64- var job = extractSourceSpans ( clone , isPreformatted ) ;
65- job . decorations = eval ( decorationsNode . innerText || decorationsNode . textContent ) ;
6657 try {
58+ // make a copy of input node (modified in-place)
59+ var clone = testInput . cloneNode ( true ) ;
60+ clone . className = '' ; // IE
61+ clone . removeAttribute ( 'class' ) ; // Not IE.
62+ actual . appendChild ( clone ) ;
63+ // run function
64+ var isPreformatted = / p r e | x m p / i. test ( clone . tagName ) ;
65+ var sourceAndSpans = extractSourceSpans ( clone , isPreformatted ) ;
66+ var job = {
67+ sourceCode : sourceAndSpans . sourceCode ,
68+ spans : sourceAndSpans . spans ,
69+ sourceNode : clone , // null
70+ pre : isPreformatted ,
71+ langExtension : null ,
72+ numberLines : null ,
73+ basePos : 0 ,
74+ decorations : eval (
75+ decorationsNode . innerText || decorationsNode . textContent )
76+ } ;
6777 recombineTagsAndDecorations ( job ) ;
6878 // compare result against expected
6979 var passed = testResult . innerHTML === actual . innerHTML ;
0 commit comments