buttons icon indicating copy to clipboard operation
buttons copied to clipboard

Inline button showing undefined & rendering issue

Open afk-procrastinator opened this issue 1 year ago • 9 comments

I've found two issues, but I'm not sure if they're bugs, how it works, or user error:

I am on Obsidian v0.15.8

inline buttons

When I try to add an inline button to a note, the button only says undefined, instead of what I would expect. For instance, this code:

```button
name git commit
type command
action Obsidian Git: Commit all changes
```
^button-commit

Creates an operational button that does the command (in this case, a Git commit using the plugin).

Screenshot 2022-07-24 at 10 19 41

But when I try to make an inline button, all I get is undefined:

> [!summary]+ Button
> `button-commit`

Screenshot 2022-07-24 at 10 22 29

rendering issue

When I open a note with buttons, the code doesn't render until I select the text, which is kind of annoying! Not sure if there's a workaround. Here's a GIF:

2022-07-24 10 26 18

Any ideas appreciated!

afk-procrastinator avatar Jul 24 '22 14:07 afk-procrastinator

same problem, happens with Obsidian 0.15 as it is rendered correctly under 0.14

cvh-obsi avatar Jul 26 '22 06:07 cvh-obsi

and same "undefined" problem too with inline button

cvh-obsi avatar Jul 26 '22 06:07 cvh-obsi

Hey, same issue as @afk-procrastinator (rendering defined button when selected, after exiting note).

Initially I had a similar undefined problem as well, but adding an empty line after the button tag fixed the issue (inline button renders fine when in reading mode. Screenshot 2022-07-26 at 14 49 55

Also, @shabegom do you know if its possible to have inline buttons rendering even in edit mode? Atm they only render when I toggle reading mode on. I really want those buttons inline for navigating daily notes haha.

Willmish avatar Jul 26 '22 13:07 Willmish

No luck... I tried adding empty lines after each callout like @Willmish reccomended, but the issue persists. I'm in Live Edit mode, I never use the source or reading modes, to be honest: 2022-07-26 14 21 36

I'm trying to have a way to have multiple columns/a grid of buttons, so they don't take up an entire long chunk — so I was going to use inline buttons with tables or something similar — for my daily notes as well! Having the next/previous day side-to-side would be great.

afk-procrastinator avatar Jul 26 '22 18:07 afk-procrastinator

Found this issue while searching for my problem, wondering if it was configuration on my side or other issue.

I seem to be having similar rendering issues as are described. I have buttons in notes and when opening the notes, the button does not show up until I have selected the button area or moved the cursor through the button definition. I'm also using the Live Preview mode.

See attached gif for demo:

obsidian button visibility

About info: Current version: v0.15.9 (Installer version: v0.15.8) Your app is up-to-date!

iar42 avatar Jul 28 '22 11:07 iar42

No luck... I tried adding empty lines after each callout like @Willmish reccomended, but the issue persists. I'm in Live Edit mode, I never use the source or reading modes, to be honest:

@afk-procrastinator , the whitespace fix only works for the problem with inline buttons appearing as undefined when rendering (as in, adding a whitespace between button definitions causes the inline button references to render properly, but only in Reading mode, they dont render in Live Edit)

Might dig around over the weekend a bit in the repo, but I am mostly just an obsidian plugin user so might not be very fruitful hah. Really like the plugin, so hoping there will be a fix.

Willmish avatar Jul 28 '22 12:07 Willmish

@Willmish, any luck at all? I'm still having the same issues... I also wanted to ping @shabegom, just in case you missed this bug! Thanks for making a great plugin :))

afk-procrastinator avatar Aug 17 '22 11:08 afk-procrastinator

Thanks for tagging me. I know there were some api changes introduce in obsidian 0.15 so it is probably to source. I'll try to find some time to take a look at this on the weekend. Sorry for the issue!

shabegom avatar Aug 17 '22 13:08 shabegom

@afk-procrastinator I am unable to recreate the undefined inline button issue. Do you know how to open the Dev Console and check for errors?

I can recreate the button not appearing in Live Preview though. Will look at that one.

shabegom avatar Aug 17 '22 22:08 shabegom