Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[docs] 修复buttons插件不适应AnyBlock的bug (fix buttons plugin does not work with plugin AnyBlock) #66

Closed
LincZero opened this issue Sep 26, 2024 · 3 comments
Labels
documentation Improvements or additions to documentation

Comments

@LincZero
Copy link
Collaborator

LincZero commented Sep 26, 2024

存在问题 (existing problem)

#14 (comment)

原因分析 (analysis of causes)

可以看到控制台有报错:

图片

判断是ob的重渲染,会导致button获取file值失败,进而报错。应该由buttons插件那边修。
看了下那边的issue也有类似的问题:shabegom/buttons#212


You can see that the console is reporting an error

Judging that it is ob rerender will cause button to fail to obtain the file value and then report an error. It should be fixed by the buttons plugin

修复方法 (restorative procedure)

在箭头所指位置添加这么一行就好了,修复后在实时/阅读模式下均正常,显示正确,点击效果也正确(仅测试了 link button)

图片


Add this line at the point of the arrow. After repair, it is normal in live/reading mode, the display is correct, and the click effect is correct (only the link button was tested).

(The upper, middle and lower parts of the picture are: modification method, the effect before modification, and the effect after modification)

@LincZero
Copy link
Collaborator Author

有空去那边PR一下,但我看他那边也挺久没更新了,也还有两个PR没合并……

@LincZero LincZero changed the title [docs] 修复buttons插件不适应AnyBlock的bug [docs] 修复buttons插件不适应AnyBlock的bug (fix buttons plugin does not work with plugin AnyBlock) Sep 26, 2024
@LincZero LincZero added the documentation Improvements or additions to documentation label Sep 26, 2024
@LincZero
Copy link
Collaborator Author

TestDemo

::: mditTabs

@tab tab1

ButtonTest1

```button
name ButtonLinkDemo
type link
action https://forum.obsidian.md/t/buttons-showcase/18044/3
color blue
```

ButtonTest2

[card|addClass(ab-col2)]
- Card2
- ButtonTest
  ```button
  name ButtonLinkDemo
  type link
  action https://forum.obsidian.md/t/buttons-showcase/18044/3
  color blue
  ```

@tab tab2

test2

:::

图片

@LincZero
Copy link
Collaborator Author

LincZero commented Oct 5, 2024

后来发现,不用修buttons那边的代码也行(主要是开始他那边报错了,直接就修复了他那边的bug也能正常用)。后来发现重渲染时我这边是可以把文件路径传过去,让他那边的ctx的文件名不为空的,也可以配合到。

3.1.6 版本开始可以能正常配合buttons插件 @laogao2005

至于meta-bind插件……暂时不行:

  • 部分btn实时/阅读模式都渲染失败
  • 部分btn实时失败而阅读模式成功

@LincZero LincZero closed this as completed Oct 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

No branches or pull requests

1 participant