Skip to content

Commit aa9e568

Browse files
committed
Release 1.0.2: clear marketplace review warnings
- main.ts: use activeDocument instead of document for popout window compatibility (Obsidian provides activeDocument as a global that resolves to the right document when the view is in a popout). - main.ts: type the (vault as { getConfig?: ... }) cast properly so the strict lint passes — no more 'unsafe any' chain. - Drop the builtin-modules dependency; node's own builtinModules from 'node:module' covers it and removes a deprecated package.
1 parent 3164282 commit aa9e568

8 files changed

Lines changed: 15 additions & 28 deletions

File tree

dist/html-docs/main.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/html-docs/manifest.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"id": "html-docs",
33
"name": "HTML Docs",
4-
"version": "1.0.1",
4+
"version": "1.0.2",
55
"minAppVersion": "1.4.0",
66
"description": "A minimal zero-dependency plugin that lets you write docs in .md or .html and open both inside your vault.",
77
"author": "smcllns",

esbuild.config.mjs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import esbuild from "esbuild";
22
import process from "process";
3-
import builtins from "builtin-modules";
3+
import { builtinModules } from "node:module";
44
import fs from "node:fs";
55
import path from "node:path";
66

@@ -35,7 +35,7 @@ const context = await esbuild.context({
3535
"@lezer/common",
3636
"@lezer/highlight",
3737
"@lezer/lr",
38-
...builtins,
38+
...builtinModules,
3939
],
4040
format: "cjs",
4141
target: "es2018",

main.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ class HtmlView extends FileView {
5555
// is created with the parent's origin — some Chromium versions
5656
// don't fully re-apply the sandbox on the subsequent navigation,
5757
// leaking same-origin privileges into user HTML.
58-
const iframe = document.createElement("iframe");
58+
const iframe = activeDocument.createElement("iframe");
5959
iframe.className = "html-docs-iframe";
6060
// allow-scripts lets the page's JS run; omitting allow-same-origin
6161
// keeps it isolated from Obsidian and the user's vault.
@@ -79,7 +79,8 @@ export default class HtmlDocsPlugin extends Plugin {
7979
// the extension only routes the view, it doesn't add to that
8080
// filter. Without this setting, the user never sees their .html
8181
// files in the explorer.
82-
const showUnsupported = (this.app.vault as any).getConfig?.("showUnsupportedFiles");
82+
const vault = this.app.vault as { getConfig?: (key: string) => unknown };
83+
const showUnsupported = vault.getConfig?.("showUnsupportedFiles");
8384
if (showUnsupported === false) {
8485
new Notice(
8586
"HTML Docs: enable 'Detect all file extensions' in Settings → Files & Links to see .html files in the file explorer.",

manifest.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"id": "html-docs",
33
"name": "HTML Docs",
4-
"version": "1.0.1",
4+
"version": "1.0.2",
55
"minAppVersion": "1.4.0",
66
"description": "A minimal zero-dependency plugin that lets you write docs in .md or .html and open both inside your vault.",
77
"author": "smcllns",

package-lock.json

Lines changed: 4 additions & 18 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "html-docs",
3-
"version": "1.0.1",
3+
"version": "1.0.2",
44
"description": "A minimal zero-dependency Obsidian plugin that lets you write docs in .md or .html and open both inside Obsidian.",
55
"main": "main.js",
66
"scripts": {
@@ -13,7 +13,6 @@
1313
"license": "MIT",
1414
"devDependencies": {
1515
"@types/node": "^16.18.0",
16-
"builtin-modules": "^3.3.0",
1716
"esbuild": "0.17.3",
1817
"obsidian": "latest",
1918
"tslib": "2.4.0",

versions.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
{
22
"1.0.0": "1.4.0",
3-
"1.0.1": "1.4.0"
3+
"1.0.1": "1.4.0",
4+
"1.0.2": "1.4.0"
45
}

0 commit comments

Comments
 (0)