table icon indicating copy to clipboard operation
table copied to clipboard

Output contains classes

Open Eggwise opened this issue 5 years ago • 2 comments

When i create this image

This is the output image

Would be nice to get clean data, not divs with classes etc in the output. Like on the Editor.js site

How do i achieve this ?

Eggwise avatar May 17 '19 15:05 Eggwise

Found a workaround for this, overriding the table with:


class TableTool extends Table {
  save(toolsContent) {
    const table = toolsContent.querySelector('table');
    const data = [];
    const rows = table.rows;

    for (let i = 0; i < rows.length; i++) {
      const row = rows[i];
      const cols = Array.from(row.cells);
      const inputs = cols.map(cell => cell.querySelector('.tc-table__inp'));
      const isWorthless = inputs.every(this._isEmpty);

      if (isWorthless) {
        continue;
      }
      data.push(inputs.map(input => {
        return input.innerHTML
      }));
    }

    return {
      content: data
    };
  }
}

stijnvanderlaan avatar Jul 29 '19 15:07 stijnvanderlaan

More to this, the two divs are wrapping the existing content each time you save. Kindly release the build with the fix at the earliest.

gopumon avatar Nov 02 '19 17:11 gopumon