mirror of
https://github.com/ueberdosis/tiptap.git
synced 2024-12-04 03:29:03 +08:00
1.4 KiB
1.4 KiB
description |
---|
Separate what needs to be separated, but use it wisely. |
HorizontalRule
Use this extension to render a <hr>
HTML tag. If you pass <hr>
in the editor’s initial content, it’ll be rendered accordingly.
Type three dashes (---
) or three underscores and a space (___
) at the beginning of a new line and it will magically transform to a horizontal rule.
Installation
# with npm
npm install @tiptap/extension-horizontal-rule
# with Yarn
yarn add @tiptap/extension-horizontal-rule
Settings
HTMLAttributes
Custom HTML attributes that should be added to the rendered HTML tag.
HorizontalRule.configure({
HTMLAttributes: {
class: 'my-custom-class',
},
})
Commands
setHorizontalRule()
Create a horizontal rule.
editor.commands.setHorizontalRule()
Source code
packages/extension-horizontal-rule/