diff --git a/.eslintrc.js b/.eslintrc.js index 4d7a1a86..36715012 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -63,6 +63,8 @@ module.exports = { '@typescript-eslint/no-unused-vars': ['error'], 'no-use-before-define': 'off', '@typescript-eslint/no-use-before-define': ['error'], + 'no-dupe-class-members': 'off', + '@typescript-eslint/no-dupe-class-members': ['error'], '@typescript-eslint/no-explicit-any': 'off', '@typescript-eslint/no-empty-interface': 'off', '@typescript-eslint/explicit-module-boundary-type': 'off', diff --git a/docs/gridsome.config.js b/docs/gridsome.config.js index 0e7d1212..daf72265 100644 --- a/docs/gridsome.config.js +++ b/docs/gridsome.config.js @@ -1,4 +1,5 @@ const path = require('path') +const visit = require('unist-util-visit') function addStyleResource(rule) { rule.use('style-resource') @@ -10,6 +11,28 @@ function addStyleResource(rule) { }) } +function tableWrapper() { + return async tree => { + visit( + tree, + 'table', + (node, index, parent) => { + if (node.type === 'table' && parent.type === 'root') { + const original = { ...node } + + node.type = 'div' + node.children = [original] + node.data = { + hProperties: { + class: 'table-wrapper', + }, + } + } + }, + ) + } +} + module.exports = { siteName: 'tiptap', titleTemplate: '%s | tiptap', @@ -26,6 +49,7 @@ module.exports = { '@gridsome/remark-prismjs', 'remark-container', 'remark-toc', + tableWrapper, ], remark: { autolinkHeadings: { diff --git a/docs/src/components/Demo/index.vue b/docs/src/components/Demo/index.vue index b1c888c5..59b675e9 100644 --- a/docs/src/components/Demo/index.vue +++ b/docs/src/components/Demo/index.vue @@ -100,6 +100,10 @@ export default { }, githubUrl() { + if (process.env.NODE_ENV === 'development') { + return `vscode://file${this.cwd}/src/demos/${this.name}/${this.files[0].name}` + } + return `https://github.com/ueberdosis/tiptap-next/tree/main/docs/src/demos/${this.name}` }, }, diff --git a/docs/src/demos/Examples/Basic/index.vue b/docs/src/demos/Examples/Basic/index.vue index b01c20a7..75de6f55 100644 --- a/docs/src/demos/Examples/Basic/index.vue +++ b/docs/src/demos/Examples/Basic/index.vue @@ -13,7 +13,7 @@ - - -