JSPM

tiptap-extension-section

1.0.0
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 13
  • Score
    100M100P100Q64604F
  • License ISC

Make tiptap support section tags, which provide predefined styles for content.

Package Exports

  • tiptap-extension-section
  • tiptap-extension-section/src/index.js

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (tiptap-extension-section) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

tiptap-extension-section

Make tiptap support section tags, which provide predefined styles for content.


NPM URL version



Install

npm install tiptap-extension-section -S

Usage

import Section from "tiptap-extension-section";

const editor = new Editor({
  element: document.querySelector(".editor"),
  extensions: [StarterKit, Section],
});
const html = `
  <section style="display: flex;flex-direction: column;align-items: center;text-align: center;">
    <section style="color: #fff;border-radius: 4px;font-weight: bold;min-width: 30px;padding: 0 4px;line-height: 30px;background-color: grey;">
      <p>01</p>
    </section>
    <section style="color: grey">
      <p><strong>公司宣传手册</strong></p>
    </section>
    <section style="color: grey">
      <p>
        <span style="font-size: 12px">COMPANY BROCHURE</span>
      </p>
    </section>
  </section>`;
editor
  .chain()
  .focus()
  .insertContent(html, {
    parseOptions: {
      preserveWhitespace: false,
    },
  })
  .run();

Relations

tiptap-appmsg-editor: https://github.com/KID-1912/tiptap-appmsg-editor