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

Do not auto format after ` (backtick) #7368

Closed
tomalec opened this issue Jun 3, 2020 · 7 comments
Closed

Do not auto format after ` (backtick) #7368

tomalec opened this issue Jun 3, 2020 · 7 comments
Labels
domain:ui/ux This issue reports a problem related to UI or UX. package:autoformat resolution:resolved This issue was already resolved (e.g. by another ticket). squad:core Issue to be handled by the Core team. type:bug This issue reports a buggy (incorrect) behavior.

Comments

@tomalec
Copy link
Contributor

tomalec commented Jun 3, 2020

This is a followup after #1239 (comment)

πŸ“ Provide detailed reproduction steps (if any)

  1. Type: `foo_bar_`

βœ”οΈ Expected result

One may expect to get `foo_bar_`: <code>foo_bar_</code>

❌ Actual result

foobar

2020-06-03 13 15 07

πŸ“ƒ Other details

This is related to #7364.

If we state that we do not follow GH, Slack, Notion convention, one may say, that this is not a bug, but a feature, to create emphasis in code element (which is not available otherwise). Some folks seem to want to style in code elements: #1239 (comment), @neongreen:

Do you think that inline styles like bold or italic should in general be available in <code>

I think they should ideally be available not only in inline code, but also in code blocks. This is useful for rich code snippets in tutorials β€” highlighting some part of the snippet for the reader, etc.

Did you mean they should be available via autoformatting, or are you fine with making them available only via explicit command (select + toolbar button click)?

//cc @oleq


If you'd like to see this fixed sooner, add a πŸ‘ reaction to this post.

@tomalec tomalec added the type:bug This issue reports a buggy (incorrect) behavior. label Jun 3, 2020
@neongreen
Copy link

neongreen commented Jun 3, 2020

Did you mean they should be available via autoformatting, or are you fine with making them available only via explicit command (select + toolbar button click)?

Only via explicit command. _, *, # are all characters common in code and I'd hate to fight the editor to enter them in inline code or code blocks.

@tomalec
Copy link
Contributor Author

tomalec commented Jun 3, 2020

Thanks for the fast feedback :)

@oleq
Copy link
Member

oleq commented Jun 4, 2020

If someone wants to create an italic inside a code block... personally, I see nothing wrong with it (there could be use-cases) and I think the editor should allow this using toolbar buttons (code command enabled in italic and vice-versa).

But when it comes to autoformatting, if you typed foo `bar[] then most likely you're creating a simple inline code and whatever text is inside of it (without white spaces) should not create a nested formatting.Β 

I think Slack is a good example:

  1. type foo `bar[], type _baz_, results in foo `bar_baz_`
  2. type foo `bar[], typeΒ  _baz_, results in foo `bar baz`

@tomalec
Copy link
Contributor Author

tomalec commented Jun 4, 2020

I'm not 100% sure if Slack's behavior is a perfect either, imagine trying to write, the following code some_boolean_flag && _private_with_snake_case.

But, I totally agree it's better than the current behavior :)

@mlewand mlewand added this to the backlog milestone Jun 29, 2020
@mlewand mlewand added squad:red domain:ui/ux This issue reports a problem related to UI or UX. labels Jun 29, 2020
@Reinmar Reinmar added squad:core Issue to be handled by the Core team. and removed squad:red labels Jul 28, 2020
@pomek pomek removed this from the backlog milestone Feb 21, 2022
@CKEditorBot
Copy link
Collaborator

There has been no activity on this issue for the past year. We've marked it as stale and will close it in 30 days. We understand it may still be relevant, so if you're interested in the solution, leave a comment or reaction under this issue.

@neongreen
Copy link

neongreen commented Nov 11, 2023

Works in current CKEditor, can be closed

@pomek
Copy link
Member

pomek commented Nov 13, 2023

Closing as completed.

@pomek pomek closed this as completed Nov 13, 2023
@pomek pomek added the resolution:resolved This issue was already resolved (e.g. by another ticket). label Nov 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
domain:ui/ux This issue reports a problem related to UI or UX. package:autoformat resolution:resolved This issue was already resolved (e.g. by another ticket). squad:core Issue to be handled by the Core team. type:bug This issue reports a buggy (incorrect) behavior.
Projects
None yet
Development

No branches or pull requests

7 participants