Closed miaogaolin closed 7 months ago
I'm really sorry. It was fine after I restarted obsidian
Please continue the discussion here @tobiasvl Could you please send me a minimal file to reproduce?
@Lisandra-dev Yes, I reproduced it just with this minimal file:
---
title: Foo
published: false
synced: true
jekyll_tags:
- foo
---
Foo
It's obviously the rewriting of "jekyll_tags" to "tags" that is causing it, as it didn't happen before I added it, but then it happened when I did - and in one front matter it says "jekyll_tags", while the other says "tags" (which is what I want). I've tried with and without regex (it doesn't need regex, but I tested it all the same).
My settings:
{
"github": {
"branch": "main",
"automaticallyMergePR": true,
"dryRun": {
"enable": false,
"folderName": "github-publisher"
},
"tokenPath": "%configDir%/plugins/%pluginID%/env",
"api": {
"tiersForApi": "Github Free/Pro/Team (default)",
"hostname": ""
},
"workflow": {
"commitMessage": "[PUBLISHER] Merge",
"name": ""
},
"verifiedRepo": true
},
"upload": {
"behavior": "obsidian",
"defaultName": "",
"rootFolder": "",
"yamlFolderKey": "",
"frontmatterTitle": {
"enable": false,
"key": "title"
},
"replaceTitle": [
{
"regex": "",
"replacement": "",
"type": "title"
}
],
"replacePath": [
{
"regex": "/blog",
"replacement": "",
"type": "path"
}
],
"autoclean": {
"enable": false,
"excluded": []
},
"folderNote": {
"enable": false,
"rename": "index.md",
"addTitle": {
"enable": false,
"key": "title"
}
},
"metadataExtractorPath": ""
},
"conversion": {
"hardbreak": false,
"dataview": true,
"censorText": [
{
"entry": "jekyll_title:",
"replace": "title:",
"after": false
}
],
"tags": {
"inline": false,
"exclude": [],
"fields": [
"jekyll_tags"
]
},
"links": {
"internal": true,
"unshared": false,
"wiki": true,
"slugify": "disable"
}
},
"embed": {
"attachments": true,
"overrideAttachments": [],
"keySendFile": [],
"notes": false,
"folder": "../assets/images",
"convertEmbedToLinks": "keep",
"charConvert": "->"
}
}
I don't know TS, but the problem might be that findAndReplaceText()
is first called with text
, then later text
and frontmatter
is concatenated, and then findAndReplaceText()
is called again on that combined text? https://github.com/ObsidianPublisher/obsidian-github-publisher/blob/7487831596c037727e7b308fa33ad6695c7f0ffa/src/conversion/convert_text.ts#L190-L210
processYaml is used if you use some settings to edit the frontmatter, like the auto adding title and tags. But maybe it create some conflict when you edit it. It's pretty strange, as I can't reproduce it.
The only advice I can send you is to uninstall Obsidian Publisher and reinstall it.
Ah. Yes, that put me on the right track (the processYaml, not the reinstallation). If you keep this issue open a while longer I'll see if I can fix it.
Yeah, no problem^^
Could you please try the 6.14.2 ?
@Lisandra-dev Yep, that seems to work! Along the lines of what I thought the issue was. Thank you!
Issue validation
Command used
Upload single current active note
Plugin version
6.14.1
Describe the bug
When replacing Properties with regular expressions, the frontmatter content will be repeated.
Replacement options:
Run replacement before the other plugin
How to reproduce ?
my own example:
regular expressions:
Replacement options:
Run replacement before the other plugin
Result:
Minimal Reproducible Example
Configuration
Relevant log output
No response
OS
Windows
Anything else?
No response
Obsidian information