Repository navigation
Conversation
Obsidian's global createDiv returns a detached element and satisfies both CodeMirror's toDOM() contract and the plugin-review scanner's prefer-create-el rule. The earlier "no change" resolution for this finding was based on a wrong assumption that all createDiv helpers append their new element. The Node-prototype method does, but the global helper doesn't (obsidian.d.ts:193). Updates docs/obsidian-review-warnings.md accordingly.
Use createDiv for widget root (plugin-review Finding 2 revisited)
nikoneex
marked this pull request as ready for review
September 4, 2026 12:33
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Rolls
devintomainfor the 1.4.2 hotfix. Tag1.4.2already exists ondev(1a2439e); this PR carries that commit — plus the createDiv fix from #12 — ontomain.Kept as a draft until the tagged GitHub release is published and Community Plugins picks up 1.4.2.
Commits in this rollup (3)
1a2439eRelease 1.4.2 — version bump (package.json / manifest.json / versions.json)ab5a7bbMerge PR Use createDiv for widget root (plugin-review Finding 2 revisited) #12 — createDiv fixed72611Use createDiv for widget root instead of ownerDocument.createElementWhat 1.4.2 ships
Under the hood:
createDivhelper (wasview.dom.ownerDocument.createElement('div')), closing the last plugin-review-scanner warning from the 2026-09 review round.That's the whole delta. No user-visible change.
Context
Follows the 1.4.1 plugin-review round; the createDiv finding was the only one we shipped 1.4.1 without fixing (on a wrong-in-hindsight belief that all
createDivhelpers append). GlobalcreateDivreturns a detached element (obsidian.d.ts:193) — exactly what CodeMirror'stoDOM()contract wants.Compatibility
Still requires Obsidian 1.4.4+.
minAppVersionunchanged.Test plan
1.4.2published withmain.js/manifest.json/styles.cssattached.gh release download 1.4.2 --repo nikoneex/obsidian-kaper --pattern main.js --output /tmp/main-1.4.2.js && gh attestation verify /tmp/main-1.4.2.js --repo nikoneex/obsidian-kapersucceeds.