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

feat: backslash to ignore shortcut event #635

Merged
merged 7 commits into from
Jan 13, 2024

Conversation

hyj1204
Copy link
Contributor

@hyj1204 hyj1204 commented Dec 28, 2023

Feature Preview

To close
AppFlowy-IO/AppFlowy#3628
AppFlowy-IO/AppFlowy#3964

Add the ability to ignore the CharacterShortcutEvent
Use \ to skip all the markdown style

For the wrapped style shortcut events
like _abc_ *abc* _abc_ ~~abc~~ `abc`

Put \ in front of the enable character.

wrapped.style.mov

For the space enabled shortcut events
like - abc, " abc, > abc, # abc, -[] ABC

Put \ in front of the character before the space

space.enable.mov

@hyj1204 hyj1204 self-assigned this Dec 28, 2023
Copy link

codecov bot commented Dec 28, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (3d373be) 76.47% compared to head (e25ee82) 76.51%.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #635      +/-   ##
==========================================
+ Coverage   76.47%   76.51%   +0.04%     
==========================================
  Files         295      295              
  Lines       13046    13070      +24     
==========================================
+ Hits         9977    10001      +24     
  Misses       3069     3069              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@Xazin
Copy link
Collaborator

Xazin commented Jan 8, 2024

I'm seeing some behavior that is quite odd, eg. this should not be formatted as well: \_hello_.

And on a sentence where formatting was previously ignored, I should still be able to continue formatting, eg all of this is ignored: _hello\_ _world_, where I expect world to be formatted italic.

Recording
Screen.Recording.2024-01-08.at.20.09.59_compressed.mp4

@hyj1204
Copy link
Contributor Author

hyj1204 commented Jan 8, 2024

@Xazin
The concept behind this ignore mechanism is whenever users type \

  1. The next character after \ will skip all the shortcut events
  2. The \ character got deleted afterward
    So in case users don’t want to format _hello_. they may type \_hello\_ to achieve it

@Xazin
Copy link
Collaborator

Xazin commented Jan 10, 2024

Seems some tests are failing that doesn't fail on main, can you take a look?

@hyj1204
Copy link
Contributor Author

hyj1204 commented Jan 11, 2024

@Xazin
Thanks for addressing that. In the previous code, I noticed that single-character formatting rules block the double-character formatting. I have added more exclusive conditions(with the comments) to prevent it.

@LucasXu0 LucasXu0 merged commit 3feff00 into AppFlowy-IO:main Jan 13, 2024
11 checks passed
q200892907 added a commit to q200892907/appflowy-editor that referenced this pull request Jan 15, 2024
* main:
  feat: support formatting greater hyphen to single arrow (AppFlowy-IO#665)
  feat: backslash to ignore shortcut event (AppFlowy-IO#635)
  fix: solve the problem that Chinese ime cannot continue deleting after deleting input content (AppFlowy-IO#672)

# Conflicts:
#	lib/src/editor/editor_component/service/ime/non_delta_input_service.dart
@hyj1204 hyj1204 deleted the feat/ignore_shortcut branch January 15, 2024 17:11
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.

None yet

3 participants