@@ -119,7 +119,10 @@ function wrapsInnerString(text, matchValue, dataAttrObject) {
119119 const [ leftSide , rightSide ] = text . split ( matchValue ) ;
120120 const openingQuote = getQuoteAtPos ( matchValue , 0 ) ;
121121 const closingQuote = getQuoteAtPos ( matchValue , matchValue . length - 1 ) ;
122- const linkText = matchValue . slice ( openingQuote ? 1 : 0 , closingQuote ? matchValue . length - 1 : undefined ) ;
122+ const linkText = matchValue . slice (
123+ openingQuote ? 1 : 0 ,
124+ closingQuote ? matchValue . length - 1 : undefined ,
125+ ) ;
123126
124127 if ( leftSide ) parent . appendChild ( document . createTextNode ( leftSide ) ) ;
125128 if ( openingQuote ) parent . appendChild ( document . createTextNode ( openingQuote ) ) ;
@@ -131,7 +134,8 @@ function wrapsInnerString(text, matchValue, dataAttrObject) {
131134
132135function replace ( portion , match , dataAttr , captureGroup ) {
133136 const { text, node, indexInMatch } = portion ;
134- const isAlreadyWrapped = ( node . parentNode . parentNode || node . parentNode ) . classList . contains ( CLASS_NAME ) ;
137+ const isAlreadyWrapped = ( node . parentNode . parentNode || node . parentNode
138+ ) . classList . contains ( CLASS_NAME ) ;
135139 if ( isAlreadyWrapped ) {
136140 return text ;
137141 }
@@ -143,7 +147,11 @@ function replace(portion, match, dataAttr, captureGroup) {
143147 return wrapsInnerString ( text , matchValue , dataAttrObject ) ;
144148 }
145149
146- const { valueStartPos, valueEndPos, portionEndPos } = getIndexes ( portion , match [ 0 ] , matchValue ) ;
150+ const { valueStartPos, valueEndPos, portionEndPos } = getIndexes (
151+ portion ,
152+ match [ 0 ] ,
153+ matchValue ,
154+ ) ;
147155 if ( valueStartPos === indexInMatch ) {
148156 if ( portionEndPos === valueEndPos ) {
149157 return createLinkElement ( text , dataAttrObject ) ;
@@ -156,7 +164,7 @@ function replace(portion, match, dataAttr, captureGroup) {
156164 return text ;
157165}
158166
159- export default function ( el , regex , mapping , captureGroup = '$1' ) {
167+ export default function ( el , regex , mapping , captureGroup = '$1' ) {
160168 if ( ! ( el instanceof HTMLElement ) ) {
161169 throw new Error ( 'must be called with a DOM element' ) ;
162170 }
0 commit comments