diff --git a/src/svg.ts b/src/svg.ts index 6f7cd85..15ef046 100644 --- a/src/svg.ts +++ b/src/svg.ts @@ -377,8 +377,7 @@ export function fitSvgToContent( // Compute content bbox via native getBBox() — accurate for curves/transforms. // Requires the SVG to be attached to a rendered DOM tree. let contentBBox: { x: number; y: number; w: number; h: number }; - // eslint-disable-next-line obsidianmd/prefer-create-el - const host = activeDocument.createElementNS('http://www.w3.org/2000/svg', 'svg'); + const host = createSvg('svg'); host.setAttribute('xmlns', 'http://www.w3.org/2000/svg'); host.setCssProps({ position: 'absolute', diff --git a/src/ui.ts b/src/ui.ts index e484a29..c18d181 100644 --- a/src/ui.ts +++ b/src/ui.ts @@ -19,7 +19,7 @@ export class ConfirmModal extends Modal { onOpen(): void { const { contentEl } = this; contentEl.empty(); - contentEl.createEl('div', { text: this._message }); + contentEl.createDiv({ text: this._message }); const actions = contentEl.createDiv({ cls: 'external-links-icon-modal-actions' }); const cancelBtn = actions.createEl('button', { text: t('Cancel'), cls: 'external-links-icon-cancel-btn' }); const okBtn = actions.createEl('button', { text: t('Confirm'), cls: 'external-links-icon-add-btn' }); @@ -135,7 +135,7 @@ function createIconUploadSection(options: IconUploadSectionOptions): { let removeState = false; const section = container.createDiv({ cls: 'external-links-icon-upload-section' }); - section.createEl('div', { text: label, cls: 'external-links-icon-upload-label' }); + section.createDiv({ text: label, cls: 'external-links-icon-upload-label' }); const body = section.createDiv({ cls: 'external-links-icon-section-body' });