fix: escape rewrite replacement, diagnostic no-op commit, doc + askpass hardening

- Use function replacer in rewriteBody to prevent $& / $$ / $` / $' pattern
  corruption when alt text or siteUrl contains dollar-sign sequences
- Detect empty staged index after `git add -A` and throw a clear
  "No changes to publish" error instead of a cryptic git failure
- Correct README flat-slug description: single image → <slug>.<ext>,
  multiple → <slug>-1.<ext>, <slug>-2.<ext> (original filename discarded)
- Harden askpass dir resolution: show a Notice and return early if
  getFullPath is absent (desktop-only guard), rather than passing a bad path

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
2026-06-19 02:32:02 +00:00
parent ee56f8c9a2
commit c6f28474e4
6 changed files with 45 additions and 5 deletions

View File

@@ -44,10 +44,13 @@ export default class JekyllPublishPlugin extends Plugin {
return;
}
const dir = normalizePath(this.app.vault.configDir + "/plugins/jekyll-publish");
const adapter = this.app.vault.adapter as any;
if (typeof adapter.getFullPath !== "function") {
new Notice("Jekyll Publish requires desktop Obsidian (filesystem access unavailable).");
return;
}
const bridge = new AskpassBridge({
dir: (this.app.vault.adapter as any).getFullPath
? (this.app.vault.adapter as any).getFullPath(dir)
: dir,
dir: adapter.getFullPath(dir),
onPrompt: (prompt) => this.promptCredential(prompt),
});
try {