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

[Bug] No backslash to ignore markdown in AppFlowy #3628

Closed
MayurSMahajan opened this issue Oct 5, 2023 · 12 comments
Closed

[Bug] No backslash to ignore markdown in AppFlowy #3628

MayurSMahajan opened this issue Oct 5, 2023 · 12 comments
Assignees
Labels
2024 editor features related to the rich-text editor new feature New feature or request

Comments

@MayurSMahajan
Copy link
Collaborator

Bug Description

Appflowy Editor is a markdown editor, we use commonly use markdown shortcuts like double underscores to make text italic, etc.
But right now there is no way to ignore the markdown syntax.
So if a user wants to surround something with two underscores and not make it italic and display it like: _sometext_.
Then it is not possible.

Other markdown editors support the use of the backslash key () to ignore the markdown syntax.

How to Reproduce

  1. Open AppFlowy
  2. Try typing something and wrap it with any markdown character preceded with backslash.
  3. Observe that the markdown is still not ignored.

Expected Behavior

Users should be able to use the backslash key to ignore the markdown syntax if they want.

Operating System

Windows 11

AppFlowy Version(s)

0.3.4

Screenshots

backslash.ignore.bug.mp4

Additional Context

This happens with Styling Markdown syntax
https://docs.appflowy.io/docs/appflowy/product/markdown#styling-text

Originally noticed in #3624

@MayurSMahajan MayurSMahajan added editor features related to the rich-text editor good first issue for experienced devs for the experienced community developers to claim hacktoberfest labels Oct 5, 2023
@PalaniappanC
Copy link

Hi @MayurSMahajan I would like to work on this issue. Please assign it to me

@MayurSMahajan
Copy link
Collaborator Author

Assigned have fun!

@PalaniappanC
Copy link

Update: I have started working on this. Will provide another update by weekend

@tmaiaroto
Copy link

Can markdown parsing be something disabled via config setting? So if off and we want markdown, typing / to bring up the menu to choose a "markdown" option (like code block, image, table, etc. already are today) would switch that block to markdown?

I like the shortcut to avoid having markdown parsed, but I would prefer to disable markdown completely by default and choose when to use it. Most times I just want a very simple text editor.

Also ok with the same backtick shortcut GitHub has, but the problem is you can't edit text in there. In other words, you need to type everything at once. If you go back in between the backticks, you're adding normal text.

The second issue is that markdown is parsed while you are in the middle of the backtick.

So you type ` and then go to type a word with two underscores before you close that backtick and things end up italic inside the red code.

Ultimately the markdown parsing makes it impossible to do anything other than use a code block if you have multiple underscores in a line. It's a way big issue actually. I know I just rattled off what are a few different issues, sorry.

@MayurSMahajan
Copy link
Collaborator Author

Hey @tmaiaroto ! Thanks for your feedback. I will create a separate issue for your feature request. A way to disable and enable markdown feature.

@Xazin
Copy link
Contributor

Xazin commented Oct 29, 2023

Note for implementation: Use RegExp and use a negative lookbehind for \.

@Xazin
Copy link
Contributor

Xazin commented Oct 29, 2023

@PalaniappanC Are you still working on this?

@PalaniappanC
Copy link

Yes @Xazin. Even if not part of hacktoberfest I would like to continue

@PalaniappanC
Copy link

I am not able to debug the backend code which has the logic for mark down

@Xazin
Copy link
Contributor

Xazin commented Oct 30, 2023

I am not able to debug the backend code which has the logic for mark down

All of the markdown parsing happens on the front end, mostly powered by character shortcuts.

There should be no backend work involved in this feature.

@DevaanshPathak
Copy link

I tried going through the front end but was unable to find the feature. Can someone link the file?

@Xazin
Copy link
Contributor

Xazin commented Dec 10, 2023

I tried going through the front end but was unable to find the feature. Can someone link the file?

Hey Devaansh, this issue is not easy to complete, hence the "good first issue for experienced devs".

There are some implications with the way we implement character shortcuts, and thus this has to be completed in the AppFlowy Editor repository.

One supposed solution would be to implement a generic check for any character shortcut that does transformations (and this would require the character shortcut to have a flag that is a promise that they do a transformation), and then if they have this flag, don't run the character shortcut if it is canceled by the backslash.

@annieappflowy annieappflowy added new feature New feature or request 2024 and removed good first issue for experienced devs for the experienced community developers to claim labels Dec 21, 2023
@annieappflowy annieappflowy moved this to Planned in AppFlowy Roadmap Dec 21, 2023
@hyj1204 hyj1204 moved this from Planned to In progress in AppFlowy Roadmap Dec 28, 2023
@hyj1204 hyj1204 moved this from In progress to Done in AppFlowy Roadmap Jan 17, 2024
@hyj1204 hyj1204 closed this as completed Jan 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
2024 editor features related to the rich-text editor new feature New feature or request
Projects
Status: Done
Development

No branches or pull requests

7 participants