Security News
PyPI Introduces Digital Attestations to Strengthen Python Package Security
PyPI now supports digital attestations, enhancing security and trust by allowing package maintainers to verify the authenticity of Python packages.
@tiptap/extension-blockquote
Advanced tools
@tiptap/extension-blockquote is an extension for the Tiptap editor that allows users to easily add and manage blockquotes within their rich text content. It provides a simple way to include blockquote formatting, making it easier to highlight quotes or important text in a visually distinct manner.
Adding a Blockquote
This code demonstrates how to add the Blockquote extension to a Tiptap editor instance and toggle a blockquote in the editor content.
import { Blockquote } from '@tiptap/extension-blockquote';
import { Editor } from '@tiptap/core';
const editor = new Editor({
extensions: [
Blockquote,
],
content: '<p>Hello World!</p>',
});
editor.chain().focus().toggleBlockquote().run();
Customizing Blockquote Styling
This code shows how to extend the Blockquote extension to add custom styling attributes and apply custom CSS to the blockquote element.
import { Blockquote } from '@tiptap/extension-blockquote';
import { Editor } from '@tiptap/core';
import { css } from 'styled-components';
const CustomBlockquote = Blockquote.extend({
addAttributes() {
return {
class: {
default: 'custom-blockquote',
},
};
},
});
const editor = new Editor({
extensions: [
CustomBlockquote,
],
content: '<p>Hello World!</p>',
});
const styles = css`
.custom-blockquote {
border-left: 4px solid #ccc;
padding-left: 16px;
color: #666;
}
`;
editor.chain().focus().toggleBlockquote().run();
The prosemirror-schema-basic package provides a basic schema for ProseMirror, including blockquote functionality. It is more low-level compared to @tiptap/extension-blockquote and requires more manual setup and configuration.
Quill is a rich text editor that includes built-in support for blockquotes. It provides a more comprehensive editor experience with a wide range of formatting options, including blockquotes, but may be more heavyweight compared to the focused functionality of @tiptap/extension-blockquote.
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.
FAQs
blockquote extension for tiptap
The npm package @tiptap/extension-blockquote receives a total of 396,405 weekly downloads. As such, @tiptap/extension-blockquote popularity was classified as popular.
We found that @tiptap/extension-blockquote 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
PyPI now supports digital attestations, enhancing security and trust by allowing package maintainers to verify the authenticity of Python packages.
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.