Closed zzxming closed 1 month ago
This pull request introduces several enhancements across multiple files in the Fluent Editor package. A new function hadProtocol(url: string)
is added to check URL protocols, improving URL validation. The Link
class is updated to manage protocols more effectively, with a new static property autoProtocol
and modifications to the create
method. The Tooltip
class integrates hadProtocol
for better URL handling in its methods. Overall, these changes refine the handling of URL protocols throughout the editor.
File Path | Change Summary |
---|---|
packages/fluent-editor/src/config/editor.utils.ts | - Added method: export function hadProtocol(url: string) to check URL protocols. |
packages/fluent-editor/src/link/formats/link.ts | - Updated import from Parchment to TypeInline . - Added static property autoProtocol . - Modified create(value) method to include protocol checking logic. |
packages/fluent-editor/src/link/modules/tooltip.ts | - Updated import to include hadProtocol . - Adjusted addHttpProtocol(url: string) to use hadProtocol . - Set LinkBlot.autoProtocol in the constructor. |
hadProtocol(url: string)
function added in the main PR for checking URL protocols.In the editor's realm, where links do play,
A new function hops in, brightening the way.
With protocols checked, both near and far,
Our URLs shine like a twinkling star.
So here's to the changes, both clever and neat,
A joyful leap forward, oh what a treat! 🐰✨
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?
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: N/A
What is the new behavior?
Does this PR introduce a breaking change?
Other information
Summary by CodeRabbit
New Features
Improvements
Bug Fixes