File tree Expand file tree Collapse file tree 1 file changed +9
-4
lines changed Expand file tree Collapse file tree 1 file changed +9
-4
lines changed Original file line number Diff line number Diff line change @@ -43,8 +43,13 @@ export function truncateElement(element) {
4343 let str = getOuterHtml ( shallowNode ) ;
4444
4545 if ( str . length < maxLen ) {
46- const endingTagIndex = str . lastIndexOf ( '<' ) ;
47- str = str . substring ( 0 , endingTagIndex ) ;
46+ let attrString = '' ;
47+ for ( const { name, value } of elementNodeMap ) {
48+ const attr = { name, value } ;
49+ attrString += ` ${ attr . name } ="${ attr . value } "` ;
50+ }
51+
52+ str = `<${ nodeName } ${ attrString } >` ;
4853 return str ;
4954 }
5055 let strLen = `<${ nodeName } >` . length ;
@@ -55,8 +60,8 @@ export function truncateElement(element) {
5560 }
5661
5762 const attr = { name, value } ;
58- let attrName = attr . name ,
59- attrValue = attr . value ;
63+ let attrName = attr . name ;
64+ let attrValue = attr . value ;
6065
6166 attrName =
6267 attrName . length > maxAttrNameOrValueLen
You can’t perform that action at this time.
0 commit comments