-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Inline element custom attribute #9038
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
Comments
行级元素只能通过更新块进行更新,所以还是使用 updateBlock 接口,有两种方式设置属性,一种是直接在 span 上带属性,另一种是使用 IAL 语法: {
"data": "foo <span data-type=\"text\" style=\"background-color: var(--b3-card-error-background); color: var(--b3-card-error-color);\" custom-data=\"test\">bar</span> baz",
"dataType": "markdown",
"id": "20230825093849-er9anul"
} 或者 {
"data": "foo <span data-type=\"text\">bar</span>{: style=\"background-color: var(--b3-card-error-background); color: var(--b3-card-error-color);\" custom-data=\"test\"} baz",
"dataType": "markdown",
"id": "20230825093849-er9anul"
} 行级属性界面就不考虑提供了,这个能力主要由插件扩展发挥。 |
emmm那么右键菜单的接口呢?可否支持?不然就不清楚想操作的是哪个元素了 |
暂时不考虑支持了,这个特性主要是提供给开发者 。
…---Original---
From: ***@***.***>
Date: Sat, Aug 26, 2023 00:12 AM
To: ***@***.***>;
Cc: ***@***.***>;"State ***@***.***>;
Subject: Re: [siyuan-note/siyuan] Inline element custom attribute (Issue#9038)
emmm那么右键菜单的接口呢?可否支持?不然就不清楚想操作的是哪个元素了
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you modified the open/close state.Message ID: ***@***.***>
|
Hi there! I would like to join in in asking for support of span inline attribute lists (IALs) as syntax in the editor, for the end user. It would greatly expand the uses of SiYuan if we could leverage the existing ability to parse and store Kramdown span ials. This would be extremely useful for SiYuan to have qualified links, e.g. modifying the example from the official documentation, annotate a link as being a reference (vs. e.g. an example)
@88250 could you consider again enabling the parsing of span IALs in the editor? It would be fine for me if it is behind a feature flag (or if it requires a keybinding such as Ctrl-Alt-i). For example: this would immediately solve my question on how to query to access inline memos, and even better because I could attach the |
@alvorithm Sorry, support for input in the editor is not considered, thank you. |
Ok, understood. Is there any other way for end users to annotate inline content so that the annotation can be later retrieved programmatically @88250 ? |
There is no interaction UI available for end-users, this is recommended through plugins, as mentioned earlier #9038 (comment) |
给行内样式加入自定义属性
In what scenarios do you need this feature?
算是一个长期的请求吧,这个应该比较麻烦(出bug的可能性比较大),不着急实现。
目前所有的插件和主题想要识别特定的块基本只能靠自定义属性,但是很多行内样式包括备注、链接和块链接,都是没有(可以储存的)自定义属性的。Dark+主题甚至是在用style储存信息,虽然可以用但是很不规范,容易造成冲突。
如果实现了行内样式的自定义属性,可以做到对于行内样式进行分类和归属,包括备注甚至可以实现本体不能实现的重叠备注和同一样式多个备注(目前Dark+主题实现的),但是也不会污染到现有的方法内容,插件和主题只会在自定义属性内部操作
Describe the optimal solution
Describe the candidate solution
No response
Other information
No response
The text was updated successfully, but these errors were encountered: