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

Refactor Markdown and Autoformat plugins to use formatTextSegmentBeforeSelectionMarker #2557

Merged
merged 10 commits into from
Apr 4, 2024

Conversation

juliaroldi
Copy link
Contributor

@juliaroldi juliaroldi commented Apr 4, 2024

AutoFormat plugin is responsible for formatting two dashes into a hyphen. This feature was ported into content model AutoFormatPlugin.
autoHyphen

Refactor the setFormat, transformHyphen, keyboardListTrigger, createLinkAfterSpace, createLink and unlink functions to use formatTextSegmentBeforeSelectionMarker function. This function is a common code between all the refactored functions. It is responsible for get the segment before the selection marker and make changes to it.
The getLinkSegment was removed, since it is not necessary anymore.

@juliaroldi juliaroldi marked this pull request as ready for review April 4, 2024 18:15
@JiuqingSong
Copy link
Collaborator

Great to see code become much shorter

@juliaroldi juliaroldi merged commit f34b360 into master Apr 4, 2024
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants