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

Typing second underscore in a paragraph makes italic from the first one #34

Closed
vokiel opened this issue Jan 21, 2020 · 7 comments · Fixed by #105
Closed

Typing second underscore in a paragraph makes italic from the first one #34

vokiel opened this issue Jan 21, 2020 · 7 comments · Fixed by #105
Assignees
Labels
upstream Dependent/related to external issues

Comments

@vokiel
Copy link

vokiel commented Jan 21, 2020

TC

  1. Start typing in a paragraph with some underscore inside the text, like:

    Just a test variable: VARIABLE_NAME and another variable

  2. Continue typing something with _ inside.

Expected: nothing changes.
Current: the whole part from the first _ get italic until the second one, the underscore disappears:

image

@fredck fredck added the upstream Dependent/related to external issues label Jan 21, 2020
@fredck
Copy link
Contributor

fredck commented Jan 21, 2020

That's certainly and issue with the auto-formatting feature and we must report it at CKEditor 5.

One could say that auto-formatting should be triggered only if the opening marker(_) is in a word boundary. It would not solve all cases, but it would help.

Auto-formatting can be undone, by pressing ctrl/cmd+z right after the formatting happens. It has its learnability issue, but it's hard to say if this will be seen as a bug or an enhancement.

@vokiel
Copy link
Author

vokiel commented Jan 21, 2020

I would rather use the _ as an opening/closing for the auto-formatting only on the beginning/end of the word respectively. Underscore inside a word should be treated as a regular character.

This case is especially visible here on GH in inline code as it is not possible to format only a part of the code.

@Reinmar
Copy link
Member

Reinmar commented Jan 29, 2020

Yup, upstream issue. Similar to ckeditor/ckeditor5#5862. And perhaps exactly this: ckeditor/ckeditor5#1239.

@Reinmar
Copy link
Member

Reinmar commented Jan 29, 2020

The minimum thing to do would be to disable all automatic things happening inside code blocks and inline code. An even better solution would be to make the opening _ work only when used at the beginning of some word and closing _ only at the end of a word, but that's more tricky.

@fredck
Copy link
Contributor

fredck commented Jan 31, 2020

and closing _ only at the end of a word

I think we're able to check only the start, because the end _, which triggers auto-formatting, happens when the user is typing and we don't know what will be typed next.

@fredck
Copy link
Contributor

fredck commented Mar 13, 2020

I'm considering disabling auto-formatting for italics when typing underscore, for the time being. It is a character used way too often and having such feature seems to cause more harm that good.

WDYGT?

@fredck
Copy link
Contributor

fredck commented Mar 20, 2020

I'm considering disabling auto-formatting for italics when typing underscore, for the time being. It is a character used way too often and having such feature seems to cause more harm that good.

I've decided to go a longer way and reviewed the auto-formatting totally. For more information, check out #105.

@fredck fredck closed this as completed Mar 20, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
upstream Dependent/related to external issues
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants