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

Markdown plugin wraps the initial content in a code block #7864

Closed
Mgsy opened this issue Aug 18, 2020 · 5 comments
Closed

Markdown plugin wraps the initial content in a code block #7864

Mgsy opened this issue Aug 18, 2020 · 5 comments
Labels
package:markdown-gfm resolution:expired This issue was closed due to lack of feedback. squad:core Issue to be handled by the Core team. status:stale type:bug This issue reports a buggy (incorrect) behavior.

Comments

@Mgsy
Copy link
Member

Mgsy commented Aug 18, 2020

A follow-up of #7859 (comment).

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

  1. Add the Markdown plugin to the all features manual test.
  2. Open the test.

βœ”οΈ Expected result

❌ Actual result


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

@Mgsy Mgsy added type:bug This issue reports a buggy (incorrect) behavior. package:markdown-gfm labels Aug 18, 2020
@Mgsy
Copy link
Member Author

Mgsy commented Sep 4, 2020

I wasn't able to reproduce it outside of the mentioned manual test, however, after adding the plugin to the online builder, our sample looks like this:

@Reinmar
Copy link
Member

Reinmar commented Sep 4, 2020

Could be due to the fact that the content of the element to be replaced is indented. Like this:

<div id=editor>
	Content
	Content
</div>

Instead of this:

<div id=editor>Content
Content</div>

The latter is correct – it's what a templating system / backend would usually output. The former is what you'd write by hand, though. Unfortunately, I can imagine more people stumbling upon this and it's also realistic for the backend to produce the former, indented form in some situations.

The right place to fix it (if I'm right about the issue) would be inside the function that reads HTML from the element to be replaced with the editor. However, it's not that obvious what it should do as whatever it trims... may be incorrect. This is – it may trim an indentation that was supposed to be there if the editor consisted only of a code block.

Therefore, documenting it somewhere that when using a markdown you probably shouldn't even use the "replace an element" form and instead promoting the config.initialData form should be safer.

@Mgsy
Copy link
Member Author

Mgsy commented Sep 4, 2020

You're right, this is the case. After removing indentation, it renders properly in the editor.

@mlewand mlewand added this to the backlog milestone Oct 26, 2020
@mlewand mlewand added the squad:core Issue to be handled by the Core team. label Oct 26, 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.

@CKEditorBot
Copy link
Collaborator

We've closed your issue due to inactivity over the last year. We understand that the issue may still be relevant. If so, feel free to open a new one (and link this issue to it).

@CKEditorBot CKEditorBot added the resolution:expired This issue was closed due to lack of feedback. label Nov 12, 2023
@CKEditorBot CKEditorBot closed this as not planned Won't fix, can't repro, duplicate, stale Nov 12, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
package:markdown-gfm resolution:expired This issue was closed due to lack of feedback. squad:core Issue to be handled by the Core team. status:stale type:bug This issue reports a buggy (incorrect) behavior.
Projects
None yet
Development

No branches or pull requests

5 participants