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 properties are not saved in RTE #10562

Open
laurent22 opened this issue Jun 10, 2024 · 2 comments · May be fixed by #10927
Open

Table properties are not saved in RTE #10562

laurent22 opened this issue Jun 10, 2024 · 2 comments · May be fixed by #10927
Assignees
Labels
bug It's a bug desktop All desktop platforms editor high High priority issues v3.1

Comments

@laurent22
Copy link
Owner

Operating system

Windows

Joplin version

3.0.6

Desktop version info

No response

Current behaviour

  • Open the RTE
  • Create a table
  • Change the properties of the table - for example, set a background colour, change the padding, etc.
  • Switch to Markdown

=> The customisations are lost

The table should be saved as HTML in this case like it is when, for example, it contains bullet points

Expected behaviour

No response

Logs

No response

@laurent22 laurent22 added bug It's a bug desktop All desktop platforms editor high High priority issues labels Jun 10, 2024
@Aarya01Patil
Copy link

I would like to solve this bug @laurent22

@pedr pedr self-assigned this Aug 22, 2024
@pedr
Copy link
Collaborator

pedr commented Aug 22, 2024

From what I understand from this task I should take the HTML generated by TInyMCE, eg:

<table class="mce-item-table" height="100" data-mce-style="border-collapse: collapse; background-color: #e03e2d; width: 50.6053%;" style="border-collapse: collapse; background-color: rgb(224, 62, 45); width: 50.6053%;">
  <head>
    <tr>
      <th style="width: 26.9737%;">asdfasdf</th>
      <th style="width: 26.9737%;">asdfasdf</th>
      <th style="width: 39.5833%;"></th>
      <th style="width: 6.4693%;"></th>
    </tr>
    </thead>
    <tbody>
      <tr>
        <td style="width: 26.9737%;"></td>
        <td style="width: 26.9737%;"></td>
        <td style="width: 39.5833%;">mce-item-table</td>
        <td style="width: 6.4693%;"></td>
      </tr>
      <tr>
        <td style="width: 26.9737%;"></td>
        <td style="width: 26.9737%;"></td>
        <td style="width: 39.5833%;"></td>
        <td style="width: 6.4693%;"></td>
      </tr>
    </tbody>
</table>

Here, the best way to identify if the table was generated by RTE would be to get the data-mce-style property, but this property is removed before reaching the turndown-plugin-gfm tables.js.

I'm trying to find where this happens to see if I could make an exception for table node, but otherwise a simple solution would be to check if the table has a style property and if it has we could keep it as HTML.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug It's a bug desktop All desktop platforms editor high High priority issues v3.1
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants