@@ -84,17 +84,11 @@ export function handleRecursive(currentDom, elementDom) {
84
84
} else if ( element . tagName . toUpperCase ( ) === syntaxManager . MULTI_SYNTAX ) {
85
85
handleMultiSyntax ( element , newElement ) ;
86
86
elementDom . appendChild ( newElement ) ;
87
- } else if ( element . tagName . toUpperCase ( ) === syntaxManager . BANNER ) {
87
+ } else if ( element . tagName . toUpperCase ( ) === syntaxManager . BANNER || element . tagName . toUpperCase ( ) === syntaxManager . BANNER_PEER_2_PEER ) {
88
88
if ( containsCustomTags ) {
89
89
throw new Error ( "Banner can't contain other tags" ) ;
90
90
}
91
91
92
- elementDom . appendChild ( handlePostQueryElement ( element , newElement ) ) ;
93
- } else if ( element . tagName . toUpperCase ( ) === syntaxManager . BANNER_PEER_2_PEER ) {
94
- if ( containsCustomTags ) {
95
- throw new Error ( "P2PBanner can't contain other tags" ) ;
96
- }
97
-
98
92
elementDom . appendChild ( handlePostQueryElement ( element , newElement ) ) ;
99
93
} else if ( element . tagName . toUpperCase ( ) === syntaxManager . SEARCH_HIGHLIGHT ) {
100
94
const markElement = document . createElement ( 'span' ) ;
@@ -697,23 +691,27 @@ function handleMultiSyntax(element, newElement) {
697
691
throw new Error ( "Syntax highlight can't contain other tags" ) ;
698
692
}
699
693
694
+ const internalElement = document . createElement ( 'div' ) ;
700
695
newElement . classList . remove ( 'multisyntax' ) ;
701
- newElement . classList . add ( 'syntax-highlight' ) ;
702
- newElement . classList . add ( 'has-blame' ) ;
703
- newElement = handleSyntaxHighlight ( fakeResyntaxElement , newElement , true , finalCode ) ;
696
+ internalElement . classList . add ( 'syntax-highlight' ) ;
697
+ internalElement . classList . add ( 'has-blame' ) ;
698
+ handleSyntaxHighlight ( fakeResyntaxElement , internalElement , true , finalCode , true ) ;
699
+
700
+ newElement . classList . add ( 'external-sh' , 'expanded' ) ;
701
+ newElement . appendChild ( internalElement ) ;
704
702
705
703
for ( const addedRow of addedRows ) {
706
704
const tempMark = document . createElement ( 'div' ) ;
707
705
tempMark . classList . add ( 'temp-mark' , 'added-row' ) ;
708
706
tempMark . style . setProperty ( '--start-mark' , addedRow ) ;
709
- newElement . appendChild ( tempMark ) ;
707
+ internalElement . appendChild ( tempMark ) ;
710
708
}
711
709
712
710
for ( const addedRow of removedRows ) {
713
711
const tempMark = document . createElement ( 'div' ) ;
714
712
tempMark . classList . add ( 'temp-mark' , 'removed-row' ) ;
715
713
tempMark . style . setProperty ( '--start-mark' , addedRow ) ;
716
- newElement . appendChild ( tempMark ) ;
714
+ internalElement . appendChild ( tempMark ) ;
717
715
}
718
716
} ) ;
719
717
0 commit comments