
Security News
Astral Launches pyx: A Python-Native Package Registry
Astral unveils pyx, a Python-native package registry in beta, designed to speed installs, enhance security, and integrate deeply with uv.
quill-delta-to-object
Advanced tools
Converts Quill's Delta format to Object (insert ops only) with properly nested lists.
This library is inspired by quill-delta-to-html.
Installation
npm install quill-delta-to-object
Usage
var QuillDeltaToObjectConverter = require('quill-delta-to-object').QuillDeltaToObjectConverter;
// TypeScript / ES6:
// import { QuillDeltaToObjectConverter } from 'quill-delta-to-object';
var deltaOps = [
{insert: "Hello\n"},
{insert: "This is colorful", attributes: {color: '#f00'}}
];
var converter = new QuillDeltaToObjectConverter(deltaOps);
var object = converter.convert();
Not Supported:
You need to tell system how to render your custom blot by registering a renderer callback function to renderCustomWith
method before calling the convert()
method.
Example:
let ops = [
{ insert: { bolditalic: 'my text' } },
];
let converter = new QuillDeltaToObjectConverter(ops);
// customOp is your custom blot op
// contextOp is the block op that wraps this op, if any.
// If, for example, your custom blot is located inside a list item,
// then contextOp would provide that op.
converter.renderCustomWith(function(customOp, contextOp){
if (op.insert.type === 'bolditalic') {
return {
type: 'text',
value: op.insert.value,
attributes: { bold: true, italic: true },
};
}
return undefined;
});
object = converter.convert();
customOp object
will have the following format:
{
insert: {
type: string //whatever you specified as key for insert, in above example: 'bolditalic'
value: any // value for the custom blot
},
attributes: {
// ... any attributes custom blot may have
}
}
FAQs
Converts Quill's delta ops to Object
The npm package quill-delta-to-object receives a total of 354 weekly downloads. As such, quill-delta-to-object popularity was classified as not popular.
We found that quill-delta-to-object demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 3 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
Astral unveils pyx, a Python-native package registry in beta, designed to speed installs, enhance security, and integrate deeply with uv.
Security News
The Latio podcast explores how static and runtime reachability help teams prioritize exploitable vulnerabilities and streamline AppSec workflows.
Security News
The latest Opengrep releases add Apex scanning, precision rule tuning, and performance gains for open source static code analysis.