File tree Expand file tree Collapse file tree 3 files changed +10
-6
lines changed Expand file tree Collapse file tree 3 files changed +10
-6
lines changed Original file line number Diff line number Diff line change @@ -19,10 +19,10 @@ export interface FrontmatterImageStateFieldValue {
1919}
2020
2121export const renderFrontmatterImage = ( src : string ) : HTMLElement => {
22- const img = document . createElement ( "img" ) ;
23- img . src = src ;
24- img . style . display = "block" ;
25- return img ;
22+ const img = document . createElement ( "img" ) ;
23+ img . src = src ;
24+ img . classList . add ( "frontmatter-image" ) ;
25+ return img ;
2626}
2727
2828export const frontmatterImageEditorExtension = (
Original file line number Diff line number Diff line change @@ -43,8 +43,9 @@ export default class FrontmatterImagePlugin extends Plugin {
4343 const div = document . createElement ( "div" ) ;
4444 const img = renderFrontmatterImage ( currentImageValue ) ;
4545 div . appendChild ( img ) ;
46- div . insertAdjacentHTML ( "beforeend" , "<br/>" ) ;
47- element . insertAdjacentElement ( "beforeend" , div ) ;
46+ const br = document . createElement ( "br" ) ;
47+ div . appendChild ( br ) ;
48+ element . appendChild ( div ) ;
4849 } ,
4950 ) ;
5051 }
Original file line number Diff line number Diff line change 1+ img .frontmatter-image {
2+ display : block;
3+ }
You can’t perform that action at this time.
0 commit comments