debian-mirror-gitlab/app/assets/javascripts/content_editor/extensions/sourcemap.js

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

81 lines
2.3 KiB
JavaScript
Raw Normal View History

2022-07-16 23:28:13 +05:30
import { Extension } from '@tiptap/core';
import Blockquote from './blockquote';
import Bold from './bold';
import BulletList from './bullet_list';
import Code from './code';
import CodeBlockHighlight from './code_block_highlight';
2022-07-23 23:45:48 +05:30
import FootnoteReference from './footnote_reference';
import FootnoteDefinition from './footnote_definition';
2022-08-27 11:52:29 +05:30
import Frontmatter from './frontmatter';
2022-07-16 23:28:13 +05:30
import Heading from './heading';
import HardBreak from './hard_break';
import HorizontalRule from './horizontal_rule';
2022-08-13 15:12:31 +05:30
import HTMLNodes from './html_nodes';
2022-07-16 23:28:13 +05:30
import Image from './image';
import Italic from './italic';
import Link from './link';
import ListItem from './list_item';
import OrderedList from './ordered_list';
import Paragraph from './paragraph';
2022-08-27 11:52:29 +05:30
import ReferenceDefinition from './reference_definition';
2022-07-23 23:45:48 +05:30
import Strike from './strike';
import TaskList from './task_list';
import TaskItem from './task_item';
import Table from './table';
import TableCell from './table_cell';
import TableHeader from './table_header';
import TableRow from './table_row';
2022-07-16 23:28:13 +05:30
export default Extension.create({
addGlobalAttributes() {
return [
{
types: [
Bold.name,
Blockquote.name,
BulletList.name,
Code.name,
CodeBlockHighlight.name,
2022-07-23 23:45:48 +05:30
FootnoteReference.name,
FootnoteDefinition.name,
2022-08-27 11:52:29 +05:30
Frontmatter.name,
2022-07-16 23:28:13 +05:30
HardBreak.name,
Heading.name,
HorizontalRule.name,
Image.name,
Italic.name,
Link.name,
ListItem.name,
OrderedList.name,
Paragraph.name,
2022-08-27 11:52:29 +05:30
ReferenceDefinition.name,
2022-07-23 23:45:48 +05:30
Strike.name,
TaskList.name,
TaskItem.name,
Table.name,
TableCell.name,
TableHeader.name,
TableRow.name,
2022-08-13 15:12:31 +05:30
...HTMLNodes.map((htmlNode) => htmlNode.name),
2022-07-16 23:28:13 +05:30
],
attributes: {
2022-08-13 15:12:31 +05:30
/**
* The reason to add a function that returns an empty
* string in these attributes is indicate that these
* attributes shouldnt be rendered in the ProseMirror
* view.
*/
2022-07-16 23:28:13 +05:30
sourceMarkdown: {
default: null,
2022-08-13 15:12:31 +05:30
renderHTML: () => '',
2022-07-16 23:28:13 +05:30
},
sourceMapKey: {
default: null,
2022-08-13 15:12:31 +05:30
renderHTML: () => '',
2022-07-16 23:28:13 +05:30
},
},
},
];
},
});