Is this issue related to missing content or incorrect conversion to Markdown?
Have you reviewed the troubleshooting instructions?
Operating system
Windows 11
Browser
Chrome
Web Clipper version
1.6.1
Obsidian version
1.12.7
Describe the bug
I think it's easier to show the bug with an example:
Here's a demo custom template showing properties with their keys written in different case styles.
{
"schemaVersion": "0.1.0",
"name": "Example Template",
"behavior": "create",
"noteContentFormat": "",
"properties": [
{
"name": "test property 0",
"value": "spaced key",
"type": "text"
},
{
"name": "test-property-1",
"value": "kebab case key",
"type": "text"
},
{
"name": "test_property_2",
"value": "snake case key",
"type": "text"
},
{
"name": "testProperty3",
"value": "camel case key",
"type": "text"
},
{
"name": "string_test-property_4",
"value": "hybrid case key",
"type": "text"
}
],
"triggers": [],
"noteNameFormat": "Example Web Clipper Template",
"path": "Example"
}
Clipping a page with this template will create a note with this yaml frontmatter in source view:
---
"test property 0": "spaced key"
"test-property-1": "kebab case key"
test_property_2: "snake case key"
testProperty3: "camel case key"
"string_test-property_4": "hybrid case key"
---
So any property key with a hyphen or space character gets outputted as a JSON property key instead of a normal yaml key with no double quotes like in the obsidan yaml documentation.
This syntax only gets reformatted when manually adding a property to the note through the property view. So in obsidan clicking "+ Add Property" then selecting the tags property the yaml will be sanitised.
---
test property 0: spaced key
test-property: kebab case key
test_property_2: snake case key
testProperty3: camel case key
string_test-property-3: hybrid case key
tags:
---
Expected behavior
Was expecting the clipper to create a note with obsdian yaml (no quotes for keys and values) rather than json yaml.
I only noticed this because I'm using the Linter Community Plugin to add frontmatter automatically on note save. If the key is "my-key" Linter will not recognise it as my-key and try to add it causing the properties view to complain about duplicate keys.
Since other community plugins use a variety of yaml key naming conventions (e.g. excalidraw uses kebab, tasks uses snake) it can make integrating the web clipper into custom workflows difficult if the keys are wrapped in double quotes.
URLs where the bug occurs
No response
To reproduce
- Import the demo template
- Clip any web page so that obsidian will create a note
- Examine the yaml frontmatter in source view
- Add the tags property using the editing view's properties view UI
- observe the yaml being sanitised
Your template file
{
"schemaVersion": "0.1.0",
"name": "Example Template",
"behavior": "create",
"noteContentFormat": "",
"properties": [
{
"name": "test property 0",
"value": "spaced key",
"type": "text"
},
{
"name": "test-property-1",
"value": "kebab case key",
"type": "text"
},
{
"name": "test_property_2",
"value": "snake case key",
"type": "text"
},
{
"name": "testProperty3",
"value": "camel case key",
"type": "text"
},
{
"name": "string_test-property_4",
"value": "hybrid case key",
"type": "text"
}
],
"triggers": [],
"noteNameFormat": "Example Web Clipper Template",
"path": "Example"
}
Is this issue related to missing content or incorrect conversion to Markdown?
Have you reviewed the troubleshooting instructions?
Operating system
Windows 11
Browser
Chrome
Web Clipper version
1.6.1
Obsidian version
1.12.7
Describe the bug
I think it's easier to show the bug with an example:
Here's a demo custom template showing properties with their keys written in different case styles.
{ "schemaVersion": "0.1.0", "name": "Example Template", "behavior": "create", "noteContentFormat": "", "properties": [ { "name": "test property 0", "value": "spaced key", "type": "text" }, { "name": "test-property-1", "value": "kebab case key", "type": "text" }, { "name": "test_property_2", "value": "snake case key", "type": "text" }, { "name": "testProperty3", "value": "camel case key", "type": "text" }, { "name": "string_test-property_4", "value": "hybrid case key", "type": "text" } ], "triggers": [], "noteNameFormat": "Example Web Clipper Template", "path": "Example" }Clipping a page with this template will create a note with this yaml frontmatter in source view:
So any property key with a hyphen or space character gets outputted as a JSON property key instead of a normal yaml key with no double quotes like in the obsidan yaml documentation.
This syntax only gets reformatted when manually adding a property to the note through the property view. So in obsidan clicking "+ Add Property" then selecting the tags property the yaml will be sanitised.
Expected behavior
Was expecting the clipper to create a note with obsdian yaml (no quotes for keys and values) rather than json yaml.
I only noticed this because I'm using the Linter Community Plugin to add frontmatter automatically on note save. If the key is "my-key" Linter will not recognise it as my-key and try to add it causing the properties view to complain about duplicate keys.
Since other community plugins use a variety of yaml key naming conventions (e.g. excalidraw uses kebab, tasks uses snake) it can make integrating the web clipper into custom workflows difficult if the keys are wrapped in double quotes.
URLs where the bug occurs
No response
To reproduce
Your template file
{ "schemaVersion": "0.1.0", "name": "Example Template", "behavior": "create", "noteContentFormat": "", "properties": [ { "name": "test property 0", "value": "spaced key", "type": "text" }, { "name": "test-property-1", "value": "kebab case key", "type": "text" }, { "name": "test_property_2", "value": "snake case key", "type": "text" }, { "name": "testProperty3", "value": "camel case key", "type": "text" }, { "name": "string_test-property_4", "value": "hybrid case key", "type": "text" } ], "triggers": [], "noteNameFormat": "Example Web Clipper Template", "path": "Example" }