shabegom / buttons

Buttons in Obsidian
The Unlicense
455 stars 47 forks source link

Inline button showing undefined & rendering issue #126

Closed afk-procrastinator closed 5 months ago

afk-procrastinator commented 1 year ago

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](https://user-images.githubusercontent.com/43354260/180651304-42a14dc1-b98e-489d-9644-33c6659f8ab5.png)

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!

cvh-obsi commented 1 year ago

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

cvh-obsi commented 1 year ago

and same "undefined" problem too with inline button

Willmish commented 1 year ago

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.

afk-procrastinator commented 1 year ago

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.

iar42 commented 1 year ago

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!

Willmish commented 1 year ago

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.

afk-procrastinator commented 1 year ago

@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 :))

shabegom commented 1 year ago

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 commented 1 year ago

@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.

uwe999 commented 1 year ago

I had the same problem with "undefined". I deleted the button and inline button, started over again and got it to work

MatanRubin commented 1 year ago

I'm having the same issues as described in this ticket (inline buttons not rendering, or rendering as undefined). Are there any updates on this one?