@@ -54,16 +54,26 @@ <h1>Recombine Tags And Decorations Test</h1>
54
54
// td.actual
55
55
var actual = testResult . nextSibling ;
56
56
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 ) ;
66
57
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
+ } ;
67
77
recombineTagsAndDecorations ( job ) ;
68
78
// compare result against expected
69
79
var passed = testResult . innerHTML === actual . innerHTML ;
0 commit comments