Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

tiptap-markdown

Package Overview
Dependencies
Maintainers
1
Versions
32
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

tiptap-markdown

Edit markdown content in tiptap editor.

  • 0.7.0
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
53K
decreased by-8.39%
Maintainers
1
Weekly downloads
 
Created
Source

Tiptap markdown

The markdown extension for Tiptap editor.

Warning
Since v0.7.0, createMarkdownEditor as been dropped in favor of a more friendly Markdown Tiptap extension. See the migration guide.

Installation

npm install tiptap-markdown

Requirements

Supports all frameworks handled by Tiptap (Vue 2, Vue 3, React, see full list...)

Usage

Basic example:

import { Editor } from '@tiptap/core';
import StarterKit from '@tiptap/starter-kit';
import { Markdown } from 'tiptap-markdown';

const editor = new Editor({
    content: "# Title",
    extensions: [
        StarterKit,
        Markdown,
    ],
});
const markdownOutput = editor.storage.markdown.getMarkdown();

API

Options

Default options:

Markdown.configure({
  html: true,              // Allow HTML input/output
  tightLists: true,        // No <p> inside <li> in markdown output
  tightListClass: 'tight', // Add class to <ul> allowing you to remove <p> margins when tight
  bulletListMarker: '-',   // <li> prefix in markdown output
  linkify: false,          // Create links from "https://..." text
  breaks: false,           // New lines (\n) in markdown input are converted to <br>
})

Methods

editor.commands.setContent('**test**') // setContent supports markdown format
editor.storage.markdown.getMarkdown(); // get current content as markdown

Custom extensions

See examples.
Check out prosemirror-markdown default serializer for examples of serialize config. Check out markdown-it plugins for parsing.

Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

Please make sure to update tests as appropriate.

License

The MIT License (MIT). Please see License File for more information.

FAQs

Package last updated on 13 May 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc