nodes.js 699 B

12345678910111213141516171819202122232425262728293031323334353637383940
  1. import { nodes as defaultNodes } from '@markdoc/markdoc'
  2. import { Fence } from '@/components/Fence'
  3. const nodes = {
  4. document: {
  5. render: undefined,
  6. },
  7. table: {
  8. ...defaultNodes.table,
  9. render: (props) => {
  10. const Table = defaultNodes.table.render
  11. return (
  12. <div className="my-6 overflow-x-auto">
  13. <Table {...props} />
  14. </div>
  15. )
  16. },
  17. },
  18. th: {
  19. ...defaultNodes.th,
  20. attributes: {
  21. ...defaultNodes.th.attributes,
  22. scope: {
  23. type: String,
  24. default: 'col',
  25. },
  26. },
  27. },
  28. fence: {
  29. render: Fence,
  30. attributes: {
  31. language: {
  32. type: String,
  33. },
  34. },
  35. },
  36. }
  37. export default nodes