Closed zzxming closed 1 month ago
The pull request introduces modifications to the fluent-editor
package, primarily adding a new optional property autoProtocol
to the IEditorConfig
interface. Changes are also made to the Link
and Tooltip
classes, including updates to import statements, method signatures, and the addition of default values for parameters. These adjustments aim to streamline the code structure and enhance type safety without altering existing functionalities significantly.
File Path | Change Summary |
---|---|
.../editor-config.interface.ts |
Added optional property autoProtocol?: boolean | string to IEditorConfig interface. |
.../link/formats/link.ts |
Updated import statement for Inline , removed statics and domNode properties, refined methods. |
.../link/index.ts |
Changed import method for Quill modules, added // @ts-expect-error comment before extendToolbar . |
.../link/modules/tooltip.ts |
Updated import for Range , modified method signatures for edit and addHttpProtocol , added options property with autoProtocol . |
Objective | Addressed | Explanation |
---|---|---|
Ensure links without protocols function correctly (#87) | ✅ |
IToolbarItem
interface, which may relate to the handling of toolbar items that could utilize the autoProtocol
property from the IEditorConfig
interface.bug
🐇 In the meadow, links do play,
WithautoProtocol
here to stay.
Simplified code, a joyful cheer,
Now protocols won't bring us fear!
Hopping through code, we find delight,
Making sure links shine bright! 🌟
@zzxming 我先合入了,不过还有个小问题,就是目前通过工具栏设置的超链接没问题了,但是初始化渲染时的超链接没有生效。
<div #editor>
<p>Hello <a href="opentiny.github.io/fluent-editor">Fluent Editor</a></p>
</div>
以上内容渲染到富文本编辑器中的超链接,没有自动带上 https://
前缀。
@zzxming 我先合入了,不过还有个小问题,就是目前通过工具栏设置的超链接没问题了,但是初始化渲染时的超链接没有生效。
<div #editor> <p>Hello <a href="opentiny.github.io/fluent-editor">Fluent Editor</a></p> </div>
以上内容渲染到富文本编辑器中的超链接,没有自动带上
https://
前缀。
理论上这个算是数据问题了,正常通过编辑器得到的应该是正常的。但如果这样是预期的话,我提交了一个修复pr #104
PR
PR Checklist
Please check if your PR fulfills the following requirements:
PR Type
What kind of change does this PR introduce?
What is the current behavior?
Issue Number: close #87
What is the new behavior?
Does this PR introduce a breaking change?
Other information
Summary by CodeRabbit
Release Notes
New Features
autoProtocol
property for automatic protocol handling in link configurations.Improvements
Link
class by removing unnecessary properties and refining import statements for better clarity.Tooltip
class with updated method signatures and default values for parameters.autoProtocol
based on user configuration for improved link handling.These updates aim to improve user experience by ensuring better link handling and clearer code structure.