Skip to content

Conversion creates broken tables #31

@pbauer

Description

@pbauer

Converting tables with bold text or with line-breaks creates tables that look ok but cannot be edited.

<table class="plain">
  <tbody>
    <tr><td><b>Text1</b></td></tr>
  </tbody>
</table>

creates

{
  '@type': 'slateTable',
  table: {
    basic: false,
    celled: true,
    compact: false,
    fixed: true,
    inverted: false,
    rows: [
      {
        key: '82dl4',
        cells: [
          {
            key: 'd74tq',
            type: 'data',
            value: [
              { type: 'strong', children: [ { text: 'Text1' } ] }
            ]
          }
        ]
      }
    ],
    striped: false
  }
}

This cell renders ok and seems editable because you can click in it but on entering any character it is emptied.

<table class="plain">
  <tbody>
    <tr><td><br/>Text</td></tr>
  </tbody>
</table>
{
  '@type': 'slateTable',
  table: {
    basic: false,
    celled: true,
    compact: false,
    fixed: true,
    inverted: false,
    rows: [
      {
        key: '7c9fn',
        cells: [
          {
            key: 'lkg0',
            type: 'data',
            value: [ { text: '\nText' } ]
          }
        ]
      }
    ],
    striped: false
  }
}

This cell renders ok but upon clicking in it when editing it throws: this.props.value[0].children is undefined

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions