Security News
GitHub Removes Malicious Pull Requests Targeting Open Source Repositories
GitHub removed 27 malicious pull requests attempting to inject harmful code across multiple open source repositories, in another round of low-effort attacks.
@tiptap/extension-horizontal-rule
Advanced tools
@tiptap/extension-horizontal-rule is an extension for the Tiptap editor that allows users to insert horizontal rules (also known as horizontal lines) into their rich text content. This can be useful for visually separating sections of content.
Insert Horizontal Rule
This feature allows you to insert a horizontal rule into the editor. The code sample demonstrates how to import the HorizontalRule extension, initialize the Tiptap editor with it, and programmatically insert a horizontal rule.
import { HorizontalRule } from '@tiptap/extension-horizontal-rule';
import { Editor } from '@tiptap/core';
const editor = new Editor({
extensions: [
HorizontalRule,
],
});
// To insert a horizontal rule programmatically
editor.chain().focus().setHorizontalRule().run();
Custom Styling for Horizontal Rule
This feature allows you to customize the styling of the horizontal rule. The code sample demonstrates how to extend the HorizontalRule extension to add a custom class to the horizontal rule element, and then initialize the Tiptap editor with this customized extension.
import { HorizontalRule } from '@tiptap/extension-horizontal-rule';
import { Editor } from '@tiptap/core';
const CustomHorizontalRule = HorizontalRule.extend({
renderHTML({ HTMLAttributes }) {
return ['hr', { class: 'custom-horizontal-rule', ...HTMLAttributes }];
},
});
const editor = new Editor({
extensions: [
CustomHorizontalRule,
],
});
prosemirror-schema-basic provides a basic schema for ProseMirror, which includes support for horizontal rules. It is more general-purpose compared to @tiptap/extension-horizontal-rule, as it provides a full schema for a basic rich text editor.
Quill is a modern WYSIWYG editor built for compatibility and extensibility. It includes built-in support for horizontal rules, among many other features. Quill is a more comprehensive solution compared to @tiptap/extension-horizontal-rule, which is a specific extension for the Tiptap editor.
Slate is a completely customizable framework for building rich text editors. It allows developers to define their own schema and includes support for horizontal rules. Slate offers more flexibility and customization options compared to @tiptap/extension-horizontal-rule.
Tiptap is a headless wrapper around ProseMirror – a toolkit for building rich text WYSIWYG editors, which is already in use at many well-known companies such as New York Times, The Guardian or Atlassian.
Documentation can be found on the Tiptap website.
Tiptap is open sourced software licensed under the MIT license.
2.1.0-rc.1 (2023-04-12)
FAQs
horizontal rule extension for tiptap
The npm package @tiptap/extension-horizontal-rule receives a total of 394,885 weekly downloads. As such, @tiptap/extension-horizontal-rule popularity was classified as popular.
We found that @tiptap/extension-horizontal-rule demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 5 open source maintainers collaborating on the project.
Did you know?
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.
Security News
GitHub removed 27 malicious pull requests attempting to inject harmful code across multiple open source repositories, in another round of low-effort attacks.
Security News
RubyGems.org has added a new "maintainer" role that allows for publishing new versions of gems. This new permission type is aimed at improving security for gem owners and the service overall.
Security News
Node.js will be enforcing stricter semver-major PR policies a month before major releases to enhance stability and ensure reliable release candidates.