Skip to content

stats.vault fails with JSON parse error on notes containing backtick+quote in code blocks #26

@OliverBokan

Description

@OliverBokan

Description

stats.vault throws an internal parse error when the vault contains notes with backtick + single-quote sequences inside fenced code blocks (e.g. PowerShell commands using backtick escaping).

Error

internal: expected hexadecimal character at line 14, column 1510:
     ...  maquina pro S3 aws s3 cp `'C:\Users\...
                                         ^

Steps to reproduce

  1. Have a vault with a note containing a fenced code block with a PowerShell command that uses backtick escaping, e.g.:
    ```powershell
    aws s3 cp `'C:\Users\username\Documents\file.txt'` s3://bucket/
    ```
    
  2. Call stats.vault
  3. Tool returns the internal parse error above instead of vault statistics

Expected behavior

stats.vault should either skip the problematic note or handle the character gracefully and return statistics for the rest of the vault.

Environment

  • kObsidian: latest (via npx -y kobsidian-mcp)
  • Client: Claude Cowork (Windows)
  • Vault: ~1,200 notes, many from Confluence exports containing PowerShell/bash code blocks
  • OS: Windows 11

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions