Skip to content

Import fails for medium-concise-summary-clipper.json — JSON parse error (unescaped quotes in selector) #30

Description

@SimoneFalzone

Reproduction

  1. Import the file templates/medium-concise-summary-clipper.json from https://github.com/obsidian-community/web-clipper-templates/blob/main/templates/medium-concise-summary-clipper.json via Settings → Import Templates.
  2. The importer fails with the following console error:
settings.js:1 Error parsing imported template: SyntaxError: Expected ',' or '}' after property value in JSON at position 1228 (line 51 column 37)
...
Import failed: Error: Error importing template. Please check the file and try again.

Observed cause

The JSON string for the tags selector contains unescaped double quotes which break JSON parsing. Example of the broken value in the file:

"value": "{{selector:a[href^="/tag/"] > div|replace:("":"-")}}",

Proposed fix

Replace the problematic line with properly escaped inner quotes, for example:

"value": "{{selector:a[href^=\"/tag/\"] > div|replace:(\"\":\"-\")}}",

(or as you suggested)

"value": "{{selector:a[href^=\"/tag/\"] > div|replace:(\"\":\"-\")}}",

Notes

  • After applying the fix, validate the JSON (e.g. with a JSON linter or node's JSON.parse) and re-import in Obsidian Web Clipper settings.
  • The issue is a blocking import failure — users cannot import this template until fixed.

Request

Please update templates/medium-concise-summary-clipper.json to escape inner quotes in the selector string so the file is valid JSON and imports successfully.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions