Security News
RubyGems.org Adds New Maintainer Role
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.
@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
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.
Security News
Research
Socket's threat research team has detected five malicious npm packages targeting Roblox developers, deploying malware to steal credentials and personal data.