FlorianWoelki / obsidian-symbols-prettifier

Symbols that prettify your knowledge base.
MIT License
36 stars 3 forks source link

Not working for me anymore in Obsidian 1.5.11 #8

Open AngelCrawford opened 8 months ago

AngelCrawford commented 8 months ago

Two days ago I updated Obsidian to version 1.5.11. Since then the Symbols Prettifier doesn't work anymore for me. None of the symbols will get replaced on my site.

More Infos:

Strange behavior: One of my vaults, with another theme and plugins, but new Obsidian version, does still work as expected. I think this could be a DAU (user is the problem) problem, but not sure.

Love the plugin and hopefully someone could have a look into this! Thanks for the nice Plugin, already use Iconize from the developer :)

EDIT: Und Grüße aus Deutschland xD

AngelCrawford commented 8 months ago

The new test vault worked after a restart, so it has to be a problem on my end. Could someone help me, or guide me, in the right direction of what I can do now, please?

notuntoward commented 7 months ago

I have the same problem, but haven't found the cause either.

FlorianWoelki commented 7 months ago

heyhey, thank you for the feedback!

i am not entirely sure what the problem is because i am not able to reproduce it at all :(

i've got obsidian 1.5.12 and the minimal theme and things just work for me. you can feel free to debug the issue yourself in the code and i am willing to help here.

btw. is there any error or something in the developer console (View -> Toggle Developer Console)?

notuntoward commented 7 months ago

I'm also using obsidian 1.5.12, and so far I've been unable to get prettifier to work on either Minimal or Gitsidian. Unfortunately, I don't know javascript, so would not be of much debugging use. For example, I can't figure out how to open developer console.

But but my list of plugins. To you, do any of these look likely to interfere with prettifier?

Update: waitaminute, are symbols like --> supposed to be surrounded in backticks? I just did this accidentally and it seems to work, although the backgrounds in the substitutions are gray, like in codeblocks. From the documentation, I didn't understand this, and maybe this is true for others, tool.

AngelCrawford commented 7 months ago

Found the problem on my site. DataviewJS is the culprit. If I have Dataview Code in my Note, then everything works as expected and all Symbols will get replaced. But if I have DataviewJS Code in the Note, then the Symbol will not get replaced.

Here is my Note.

image

\```dataviewjs
const startOfWeek = moment(dv.current().file.name, 'YYYY-MM-DD - 📆 dddd').isoWeekday("Monday");
const endOfWeek = moment(startOfWeek).add(6, 'days');
let daymojis = {};

for (let day = 0; day <= 6; day++) {
    let currentDate = moment(startOfWeek).add(day, 'days').format("YYYY-MM-DD");
    let fileNamePath = moment(currentDate).format("YYYY-MM-DD - 📆 dddd");
    let fileName = `"` + dv.current().file.folder + "/" + fileNamePath + `"`;
    let dailyNote = dv.pages(fileName);

    if (dailyNote.length > 0) {
        let daymoji = dailyNote[0].Daymoji;
        let weekday = moment(currentDate).format('dddd');
        let icon = "";
        daymojis[weekday] = daymoji ? daymoji + " " + icon : icon;
    }
}

dv.table(
    ["Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday", "Sunday"],
    [
        [
            daymojis["Monday"] || "",
            daymojis["Tuesday"] || "",
            daymojis["Wednesday"] || "",
            daymojis["Thursday"] || "",
            daymojis["Friday"] || "",
            daymojis["Saturday"] || "",
            daymojis["Sunday"] || ""
        ]
    ]
);
\```

# 🏢 08.04. Monday

* **Daymoji**:: 🖊
- Will **not work** => -> 

> [!multi-column]
> 
>> [!example]+ Heute erstellt
>> ```dataview
>> LIST
>> WHERE file.cday = this.file.day AND file.path != this.file.path
>> SORT file.cday ASC
>> LIMIT 10
>> ```
>
>> [!note]+ Heute geändert
>> ```dataview
>> LIST
>> WHERE file.mday = this.file.day AND file.path != this.file.path
>> SORT file.mday ASC
>> LIMIT 10
>> ```

- This **will work** ⇒ → 
FlorianWoelki commented 7 months ago

thanks for the detailed report. unfortunately, I am still not able to reproduce it :(

image

if you create a new note and just use my markdown here, does it work for you?

- **Daymoji**:
- Will **not work** → ⇒ 
\```dataviewjs
const startOfWeek = moment(dv.current().file.name, 'YYYY-MM-DD - 📆 dddd').isoWeekday("Monday");
const endOfWeek = moment(startOfWeek).add(6, 'days');
let daymojis = {};

for (let day = 0; day <= 6; day++) {
    let currentDate = moment(startOfWeek).add(day, 'days').format("YYYY-MM-DD");
    let fileNamePath = moment(currentDate).format("YYYY-MM-DD - 📆 dddd");
    let fileName = `"` + dv.current().file.folder + "/" + fileNamePath + `"`;
    let dailyNote = dv.pages(fileName);

    if (dailyNote.length > 0) {
        let daymoji = dailyNote[0].Daymoji;
        let weekday = moment(currentDate).format('dddd');
        let icon = "";
        daymojis[weekday] = daymoji ? daymoji + " " + icon : icon;
    }
}

dv.table(
    ["Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday", "Sunday"],
    [
        [
            daymojis["Monday"] || "",
            daymojis["Tuesday"] || "",
            daymojis["Wednesday"] || "",
            daymojis["Thursday"] || "",
            daymojis["Friday"] || "",
            daymojis["Saturday"] || "",
            daymojis["Sunday"] || ""
        ]
    ]
);
\```
- this will work → ⇒ 
AngelCrawford commented 7 months ago

if you create a new note and just use my markdown here, does it work for you?

With your Code it worked like it should. So, new research of the culprit.

I removed every part of my markdown in the daily bit after bit. And if I remove the last part, then it works. But the strange part: If I create a new file, only with the last removed part, then replacing of symbols works like it should.

Could the combination from DataviewJS and Dataview in one note be the problem?