diff options
Diffstat (limited to 'app/assets/javascripts/behaviors/markdown/nodes/table_row.js')
-rw-r--r-- | app/assets/javascripts/behaviors/markdown/nodes/table_row.js | 30 |
1 files changed, 10 insertions, 20 deletions
diff --git a/app/assets/javascripts/behaviors/markdown/nodes/table_row.js b/app/assets/javascripts/behaviors/markdown/nodes/table_row.js index 5852502773a..3830dae4f0d 100644 --- a/app/assets/javascripts/behaviors/markdown/nodes/table_row.js +++ b/app/assets/javascripts/behaviors/markdown/nodes/table_row.js @@ -1,22 +1,12 @@ -/* eslint-disable class-methods-use-this */ - -import { Node } from 'tiptap'; - // Transforms generated HTML back to GFM for Banzai::Filter::MarkdownFilter -export default class TableRow extends Node { - get name() { - return 'table_row'; - } - - get schema() { - return { - content: 'table_cell+', - parseDOM: [{ tag: 'tr' }], - toDOM: () => ['tr', 0], - }; - } - - toMarkdown(state, node) { +export default () => ({ + name: 'table_row', + schema: { + content: 'table_cell+', + parseDOM: [{ tag: 'tr' }], + toDOM: () => ['tr', 0], + }, + toMarkdown: (state, node) => { const cellWidths = []; state.flushClose(1); @@ -34,5 +24,5 @@ export default class TableRow extends Node { state.closeBlock(node); return cellWidths; - } -} + }, +}); |