add content

This commit is contained in:
Hans Pagel
2020-11-05 14:39:28 +01:00
parent 8147172325
commit 520cc318a6
9 changed files with 208 additions and 178 deletions

View File

@@ -88,3 +88,14 @@ You should really consider to work with HTML or JSON to store your content, they
If you still think you need Markdown, [Nextcloud Text](https://github.com/nextcloud/text) uses tiptap 1 to work with Markdown. Their code is open source, so maybe you can learn from them.
That said, tiptap **does** support Markdown shortcuts to format your content. Try typing `**two asterisks**` to make your text bold for example.
## Generate HTML from ProseMirror JSON
If you need to render the content on the server side, for example to render a blog post which was written with tiptap, youll probably need a way to do just that without an actual editor instance.
Thats what `generateHTML()` is for. Its a utility function that renders HTML without an actual editor instance.
:::info Browser-only rendering
Import a lightweight implementation from `@tiptap/core` if youre using the function in a browser context only.
:::
<demo name="Api/Schema/GenerateHTML" highlight="6,29-33"/>