-
Notifications
You must be signed in to change notification settings - Fork 94
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #3523 from nextcloud/fix/list-style
Preserve bullet list style and change default style to `-`
- Loading branch information
Showing
25 changed files
with
205 additions
and
118 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import { Editor } from '@tiptap/core' | ||
import { Document } from '@tiptap/extension-document' | ||
import { Text } from '@tiptap/extension-text' | ||
import Paragraph from '../../src/nodes/Paragraph.js' | ||
|
||
export const createCustomEditor = ({ content, extensions }) => { | ||
return new Editor({ | ||
content, | ||
extensions: [Document, Paragraph, Text, ...extensions], | ||
}) | ||
} |
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
import { createMarkdownSerializer } from '../extensions/Markdown' | ||
import { Editor } from '@tiptap/core' | ||
|
||
import Document from '@tiptap/extension-document' | ||
import Paragraph from '../nodes/Paragraph' | ||
import Text from '@tiptap/extension-text' | ||
|
||
import createEditor from '../EditorFactory' | ||
import markdownit from '../markdownit' | ||
|
||
export function createCustomEditor({ content, extensions }) { | ||
return new Editor({ | ||
content, | ||
extensions: [ | ||
Document, | ||
Paragraph, | ||
Text, | ||
...extensions, | ||
] | ||
}) | ||
} | ||
|
||
/** | ||
* Ease markdown through TipTap editor and return serialized markdown | ||
* | ||
* @param {string} markdown | ||
* @returns {string} | ||
*/ | ||
export function markdownThroughEditor(markdown) { | ||
const tiptap = createEditor({ | ||
content: markdownit.render(markdown), | ||
enableRichEditing: true | ||
}) | ||
const serializer = createMarkdownSerializer(tiptap.schema) | ||
return serializer.serialize(tiptap.state.doc) | ||
} | ||
|
||
/** | ||
* Ease HTML as input through the Editor and return the serialized markdown | ||
* | ||
* @param {string} html | ||
* @returns {string} | ||
*/ | ||
export function markdownThroughEditorHtml(html) { | ||
const tiptap = createEditor({ | ||
content: html, | ||
enableRichEditing: true | ||
}) | ||
const serializer = createMarkdownSerializer(tiptap.schema) | ||
return serializer.serialize(tiptap.state.doc) | ||
} |
Oops, something went wrong.