How to use the prosemirror-markdown.defaultMarkdownSerializer.marks function in prosemirror-markdown

To help you get started, we’ve selected a few prosemirror-markdown examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github gitlabhq / gitlabhq / app / assets / javascripts / content_editor / services / markdown_serializer.js View on Github external
serialize: ({ schema, content }) => {
      const document = schema.nodeFromJSON(content);
      const serializer = new ProseMirrorMarkdownSerializer(defaultMarkdownSerializer.nodes, {
        ...defaultMarkdownSerializer.marks,
        bold: {
          // creates a bold alias for the strong mark converter
          ...defaultMarkdownSerializer.marks.strong,
        },
        italic: { open: '_', close: '_', mixable: true, expelEnclosingWhitespace: true },
      });

      return serializer.serialize(document, {
        tightLists: true,
      });
    },
  };
github gitlabhq / gitlabhq / app / assets / javascripts / content_editor / services / markdown_serializer.js View on Github external
serialize: ({ schema, content }) => {
      const document = schema.nodeFromJSON(content);
      const serializer = new ProseMirrorMarkdownSerializer(defaultMarkdownSerializer.nodes, {
        ...defaultMarkdownSerializer.marks,
        bold: {
          // creates a bold alias for the strong mark converter
          ...defaultMarkdownSerializer.marks.strong,
        },
        italic: { open: '_', close: '_', mixable: true, expelEnclosingWhitespace: true },
      });

      return serializer.serialize(document, {
        tightLists: true,
      });
    },
  };
github gitlabhq / gitlabhq / app / assets / javascripts / behaviors / markdown / marks / math.js View on Github external
close(state, mark, parent, index) {
        return `${defaultMarkdownSerializer.marks.code.close(state, mark, parent, index)}$`;
      },
    };
github gitlabhq / gitlabhq / app / assets / javascripts / behaviors / markdown / marks / link.js View on Github external
open(state, mark, parent, index) {
        const open = defaultMarkdownSerializer.marks.link.open(state, mark, parent, index);
        return open === '<' ? '' : open;
      },
      close(state, mark, parent, index) {
github gitlabhq / gitlabhq / app / assets / javascripts / behaviors / markdown / marks / math.js View on Github external
open(state, mark, parent, index) {
        return `$${defaultMarkdownSerializer.marks.code.open(state, mark, parent, index)}`;
      },
      close(state, mark, parent, index) {
github gitlabhq / gitlabhq / app / assets / javascripts / behaviors / markdown / marks / link.js View on Github external
close(state, mark, parent, index) {
        const close = defaultMarkdownSerializer.marks.link.close(state, mark, parent, index);
        return close === '>' ? '' : close;
      },
    };