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

Table cell discards custom text alignment #1620

Closed
felipegiotto opened this issue Mar 12, 2019 · 4 comments
Closed

Table cell discards custom text alignment #1620

felipegiotto opened this issue Mar 12, 2019 · 4 comments
Assignees
Labels
package:table type:bug This issue reports a buggy (incorrect) behavior.
Milestone

Comments

@felipegiotto
Copy link

Is this a bug report or feature request? (choose one)

🐞 Bug report

💻 Version of CKEditor

CKEditor 5, Decoupled build, v12.0.0

📋 Steps to reproduce

  1. Edit "sample/index.html" and create a link to "reload" the editor content: window.editor.setData(window.editor.getData());
  2. Open the file in the browser, create a table and set the "center" text alignment in one or more cells.
  3. Click the link

✅ Expected result

The editor content (including the centered text alignment) should be retained.

❎ Actual result

The text changes to left (default) alignment.

📃 Other details that might be useful

The editor uses the HTML <td style="text-align:center;">Ce</td> to denote a table cell with centered text. But, it fails to parse this HTML, and discards the text align information.

@Mgsy
Copy link
Member

Mgsy commented Mar 12, 2019

I can confirm this behaviour.

cc @jodator

@jodator
Copy link
Contributor

jodator commented Mar 12, 2019

Such feature is not implemented (styling table cells). You can style paragraphs inside table cells.

<td>
    <p style="text-align:center">foo</p>
</td>

Related issue: https://github.com/ckeditor/ckeditor5-table/issues/122.

@felipegiotto
Copy link
Author

@jodator, the problem is that the editor itself is styling the table cells, when I create a table and change the alignment, as I'm setting the same editor document, without changing anything.
Maybe the Table plugin should create this <p> element, with the style attribute?

@jodator jodator added type:bug This issue reports a buggy (incorrect) behavior. status:confirmed package:table labels Mar 13, 2019
@jodator
Copy link
Contributor

jodator commented Mar 13, 2019

Maybe the Table plugin should create this <p> element, with the style attribute?

Well this is exactly how table feature works should work with alignment feature.

@Reinmar: Unfortunatelly we have a regression.
The expected behavior is that ediotr.getData() should return:

<figure class="table">
	<table>
		<tbody>
		<tr>
			<td>
				<p style="text-align:right;">a</p>
			</td>
		</tr>
		</tbody>
	</table>
</figure>

but it's returning

<figure class="table">
	<table>
		<tbody>
		<tr>
			<td style="text-align:right;">a</td>
		</tr>
		</tbody>
	</table>
</figure>

@jodator jodator added this to the iteration 23 milestone Mar 13, 2019
@jodator jodator self-assigned this Mar 13, 2019
Reinmar added a commit to ckeditor/ckeditor5-table that referenced this issue Apr 3, 2019
Fix: Single paragraphs with attributes inside tableCell will be properly converted in data pipeline.. Closes ckeditor/ckeditor5#1620.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
package:table type:bug This issue reports a buggy (incorrect) behavior.
Projects
None yet
Development

No branches or pull requests

3 participants