quasar-tiptap icon indicating copy to clipboard operation
quasar-tiptap copied to clipboard

How to disable title

Open Elvanos opened this issue 4 years ago • 5 comments

Hello, Just quickly asking how to disable the main title from the editor. I couldn't find any way how to get rid of it if that doesn't throw an error and crash the component.

Elvanos avatar Jan 17 '21 23:01 Elvanos

I have no idea if this is the correct way, but I changed the return value of Placeholder:

                    ...
                    "OPrint",
                    "OImage",
                    "OEmbed",
                    new Placeholder({
                        showOnlyCurrent: false,
                        emptyNodeText: node => {
                            if (node.type.name === "title") {
                                return "Title";
                            }
                            return "";  // jayb was "Content"
                        },
                    }),

jaybo avatar Jan 18 '21 21:01 jaybo

Sadly I found no answer for this and ended up using the default Quasar WYSIWYG, since this issue was a complete dealbreaker for me. Please fix this in the near future if possible.

Elvanos avatar Jan 30 '21 13:01 Elvanos

remove 'OTitle','ODoc' in extensions:

leteu avatar Mar 08 '21 05:03 leteu

remove 'OTitle','ODoc' in extensions:

I tried, this crashes the whole script.

Elvanos avatar Mar 21 '21 22:03 Elvanos

I just tried it myself:

extensions: [
      "Bold",
      "Italic",
      "Strike",
      "Underline",
      "Code",
      "CodeBlock",
      "CodeBlockHighlight",
      "BulletList",
      "OrderedList",
      "ListItem",
      "TodoList",
      "HorizontalRule",
      "Table",
      "Link",
      // 'OTitle',
      // 'ODoc',
      "OParagraph",
      "OBlockquote",
      "OTodoItem",
      "OHeading",
      "OAlignment",
      "OIndent",
      "OLineHeight",
      "OForeColor",
      "OBackColor",
      "OFontFamily",
      "OIframe",
      "ODiagram",
      "OKatexBlock",
      "OKatexInline",
      "OFormatClear",
      "OPrint",
      "OImage",
      "OEmbed",
      "OInsertHtml",
      "OLink",
      new Placeholder({
        showOnlyCurrent: false,
        emptyNodeText: (node) => {
          return "Start writing here.";
        },
      }),
    ],

works for me

leerobert avatar Mar 21 '21 22:03 leerobert