This commit is contained in:
moz 2026-07-18 13:41:21 +08:00
parent 3fbd6287a2
commit 41acb0c1bc
2 changed files with 3 additions and 4 deletions

View file

@ -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',

View file

@ -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' });