@@ -39,7 +39,6 @@ function applyColorSchemePreference() {
3939storeColorSchemePreference ( )
4040applyColorSchemePreference ( )
4141
42-
4342function addAnnotations ( ) {
4443 for ( const codeBlock of document . querySelectorAll ( '.highlighter-rouge' ) ) {
4544 const comment = parseCommentNode ( codeBlock )
@@ -68,7 +67,7 @@ function parseCommentNode(el) {
6867 return {
6968 noDemo : type . match ( / n o _ d e m o / ) ,
7069 onlyDemo : type . match ( / o n l y _ d e m o / ) ,
71- annotations : type . match ( / a n n o t a t i o n s / ) && details ,
70+ annotations : type . match ( / a n n o t a t i o n s / ) && details
7271 }
7372}
7473
@@ -80,7 +79,7 @@ function annotate(codeBlock, items) {
8079 for ( const item of items ) {
8180 let currentNode = el
8281 const [ pattern , rest ] = item . split ( / : / )
83- const [ title , link ] = ( rest || '' ) . split ( / \| / )
82+ const [ title , link ] = ( rest || '' ) . split ( / \| / )
8483 const parts = pattern . split ( ' ' )
8584 let toAnnotate = [ ]
8685 for ( const part of parts ) {
@@ -100,7 +99,7 @@ function annotate(codeBlock, items) {
10099 }
101100 annotated . set ( node , title )
102101 const a = document . createElement ( 'a' )
103- a . className = node . className + ' code-tooltip tooltipped tooltipped-multiline tooltipped-se bg-gray text-underline'
102+ a . className = ` ${ node . className } code-tooltip tooltipped tooltipped-multiline tooltipped-se bg-gray text-underline`
104103 a . id = `match-${ matchIndex ++ } `
105104 a . href = link || `#${ a . id } `
106105 a . setAttribute ( 'data-title' , title )
@@ -113,6 +112,7 @@ function annotate(codeBlock, items) {
113112 }
114113 }
115114 for ( const pattern of noMatch ) {
115+ // eslint-disable-next-line no-console
116116 console . error ( `Code annotations: No match found for "${ pattern } "` )
117117 }
118118}
0 commit comments