Comments (5)
通过问题2的 API hasClosestBlock
就可以解决问题1了。需要的话我先把 hasClosestBlock 开放出去。由于 getEditorRange 会根据使用场景进行判断,如果光标不在 editor 中会将其设置到第一个块中,从而改变光标的原有位置,就先不放出去了。
from petal.
@Vanessa219
问题1 解决了(用的Zuoqiu-Yingyi的代码),然后我想实现把段落块转换为列表块,之前在思源源码里调用 turnsIntoOneTransaction 加 type:Blocks2ULs ,很方便,但没开放给插件用,建议开放 , 再加上个 focusBlock .
话说能不能让插件无缝对接思源源码,即能够直接使用思源源码里任意函数而不需要特意开放?
from petal.
我抽空整理一下吧。为了安全性思源源码目前不能直接使用,有需求提就好了,我们会尽快完善的。
from petal.
- turnIntoOneTransaction
- turnIntoTransaction
- updateTransaction
- updateBatchTransaction
- getRange
- hasClosestBlock
- focusBlock
from petal.
@Vanessa219 nice~
from petal.
Related Issues (14)
- Meeting 2023.4.15 HOT 1
- load.js 文件地址替换,gitee 需要登录才能访问,会导致加载失败 HOT 1
- Move the plugin system entry to the marketplace
- FileApi 兼容性移除
- 迁移老商店上的插件 HOT 1
- API 框架和代理实例
- 插件注册的快捷键被macOS组合输入干扰
- Add protyle to the Protyle class
- 打开插件管理页面速度太慢 HOT 3
- Improve Global.Lute type HOT 2
- Update `Dialog`
- 列表api HOT 4
- [需求] setting类Callback传入对话框元素 HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from petal.