File tree Expand file tree Collapse file tree 2 files changed +5
-7
lines changed Expand file tree Collapse file tree 2 files changed +5
-7
lines changed Original file line number Diff line number Diff line change @@ -179,13 +179,11 @@ const FilterUtil = {
179179 */
180180 cleanAttributes ( arg : { data : ParseOptions } ) {
181181 const node = arg . data . root ;
182- node . walkTree ( ( mml : MmlNode , _d : any ) => {
183- const attribs = mml . attributes ;
184- if ( ! attribs ) return ;
182+ node . walkTree ( ( mml : MmlNode ) => {
185183 const keep = new Set (
186- ( ( attribs . get ( 'mjx- keep-attrs') as string ) || '' ) . split ( / / )
184+ ( ( mml . getProperty ( ' keep-attrs') as string ) || '' ) . split ( / / )
187185 ) ;
188- attribs . unset ( 'mjx-keep-attrs' ) ;
186+ const attribs = mml . attributes ;
189187 for ( const key of attribs . getExplicitNames ( ) ) {
190188 if (
191189 ! keep . has ( key ) &&
@@ -194,7 +192,7 @@ const FilterUtil = {
194192 attribs . unset ( key ) ;
195193 }
196194 }
197- } , { } ) ;
195+ } ) ;
198196 } ,
199197
200198 /**
Original file line number Diff line number Diff line change @@ -1125,7 +1125,7 @@ const BaseMethods: { [key: string]: ParseMethod } = {
11251125 attr = attr . substring ( match [ 0 ] . length ) ;
11261126 }
11271127 if ( keep . length ) {
1128- def [ 'mjx- keep-attrs'] = keep . join ( ' ' ) ;
1128+ node . setProperty ( ' keep-attrs', keep . join ( ' ' ) ) ;
11291129 }
11301130 const textNode = parser . create ( 'text' , replaceUnicode ( text ) ) ;
11311131 node . appendChild ( textNode ) ;
You can’t perform that action at this time.
0 commit comments