Richardsl / heatmap-calendar-obsidian

An Obsidian plugin for displaying data in a calendar similar to the github activity calendar
Apache License 2.0
623 stars 103 forks source link

Hover preview is not working with file names that contain a space character #42

Closed vadimtrifonov closed 1 year ago

vadimtrifonov commented 1 year ago

Here is the part of my script where I setup the hover preview:

...
data.entries.push(
    {
        date: page.started,
        intensity: 1,
        content: await dv.span(`[](${page.file.name})`) // not working as expected
    }
)
...

Here is the result with a file named Europe:

Screen Shot 2022-09-23 at 17 55 29

Here is the result with a file named Europe Test:

Screen Shot 2022-09-23 at 17 57 47

Splitting the file name by a space character solves the rendering issue, but, naturally, prevents the Heatmap from displaying the file contents.

await dv.span(`[](${page.file.name.split(" ")["0"]})`)
Screen Shot 2022-09-23 at 18 00 23
Richardsl commented 1 year ago

The plugin was really just intended for daily notes with the title format YYYY-MM-DD. Maybe you could modify the code used in this issue: https://github.com/Richardsl/heatmap-calendar-obsidian/discussions/2

Richardsl commented 1 year ago

or possibly this solution from another issue: image