mirror of
https://github.com/DominikDoom/a1111-sd-webui-tagcomplete.git
synced 2026-11-05 00:17:25 +00:00
[GH-ISSUE #307] Backslash ( \ ) in chants.json breaks the chant feature #211
Labels
No labels
bug
duplicate
enhancement
help wanted
invalid
low priority
low priority
pull-request
question
waiting for feedback
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
DominikDoom/a1111-sd-webui-tagcomplete#211
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @blue-popsicle on GitHub (Oct 31, 2024).
Original GitHub issue: https://github.com/DominikDoom/a1111-sd-webui-tagcomplete/issues/307
Some chants I want to put in the chants.json file need to include the backslash ( \ ) character due to tags which include parentheses.
However, putting a backslash anywhere in the chants.json file breaks the Webui's ability to load any chants at all.
Seems to be another broken sanitization rule similar to Issue #267
@DominikDoom commented on GitHub (Oct 31, 2024):
The loading and sanitization is fine, I think your issue is rather not escaping the char in the JSON itself.
\is an escape sequence marker, so writing\(in JSON will be invalid. It expects an actual sequence like\n(newline) or\"to escape a double quote inside the string. For a literal\, you have to double it:\\.To summarize:
artoria_pendragon_(fate)Defaultartoria_pendragon_\(fate\)Invalid JSON syntax, will break the fileartoria_pendragon_\\(fate\\)Works and will output what you expectI would recommend editing JSON in an editor with syntax highlighting, e.g. VSCode:



Or Notepad++:
That will make spotting such errors easy.
@blue-popsicle commented on GitHub (Nov 2, 2024):
Ahhh, I see, that makes sense. Thank you for the explanation! I got it working properly.