RoamJS / smartblocks

MIT License
24 stars 7 forks source link

Support SmartBlock Buttons in Roam {{[[table]]}} #118

Open mdroidian opened 5 months ago

mdroidian commented 5 months ago

reported by Mark L via slack.

tl;dr What's left

Notes

I started looking into this, but didn't get a chance to finish. Here were my findings:

If a SmartBlock button is part of roam {{[[table]]}} the observer doesn't catch it because it's parent blockUid is actually the table block, so the match check fails as there is no SmartBlock button in it's textContent.

image

It doesn't look like there the original uid that holds the SmartBlock button (VeSLtlz0N) is accessible in the DOM

image

Possible solution: https://github.com/RoamJS/smartblocks/blob/170690d1ba36d416d17545ca39483dd18a0dfd77/src/index.ts#L543-L561

If !match we could check text (which is parentUid text) for {{[[table]]}}

If true