File tree Expand file tree Collapse file tree 2 files changed +8
-6
lines changed Expand file tree Collapse file tree 2 files changed +8
-6
lines changed Original file line number Diff line number Diff line change 11{
22 "name" : " vscode-web-visual-editor" ,
3- "version" : " 0.1.7 " ,
3+ "version" : " 0.1.8 " ,
44 "displayName" : " Web Visual Editor" ,
55 "description" : " Edit HTML files visually." ,
66 "categories" : [
Original file line number Diff line number Diff line change @@ -285,13 +285,15 @@ export class VisualEditorProvider implements vscode.CustomTextEditorProvider {
285285 }
286286 }
287287 nameToRemove . forEach ( name => el . removeAttribute ( name ) ) ;
288- // Add source code location information to all elements in body
289- const location = dom . nodeLocation ( el ) ;
290- if ( ! location ) { throw Error ( `Failed to get nodeLocation of element ${ el } ` ) ; }
291- el . setAttribute ( 'data-wve-code-start' , location . startOffset . toString ( ) ) ;
292- el . setAttribute ( 'data-wve-code-end' , location . endOffset . toString ( ) ) ;
293288 } ) ;
294289 }
290+ document . querySelectorAll ( 'body *, body' ) . forEach ( el => {
291+ // Add source code location information to all elements in body
292+ const location = dom . nodeLocation ( el ) ;
293+ if ( ! location ) { throw Error ( `Failed to get nodeLocation of element ${ el } ` ) ; }
294+ el . setAttribute ( 'data-wve-code-start' , location . startOffset . toString ( ) ) ;
295+ el . setAttribute ( 'data-wve-code-end' , location . endOffset . toString ( ) ) ;
296+ } ) ;
295297 // Disable links and file selection inputs
296298 document . body . querySelectorAll ( 'a[href]' ) . forEach (
297299 el => el . setAttribute ( 'onclick' , 'event.preventDefault(), event.stopPropagation()' )
You can’t perform that action at this time.
0 commit comments