Select and Convert multiple blocks to one blockš”
Feature: I have a bunch paragraphs I'd like to arrange into a list.
Behaviour: Select multiple blocks, click, and the conversion tool appears and I can make a conversion into one block. Conversion config would need to have a new field on how to merge multiple blocks.
Are there any alternatives? It's very tedious to create and modify lists from existing content. The only alternative is to backspace all paragraphs into one paragraph and then convert to list - which isn't intuitive.
I'll try to create a pr on this soon.
^ PR above, let me know if you have any feedback
Additional configuration will be added to header and nested list libraries:
// list mergeImport
mergeImport: (arr: string[]) => {
return {
items: arr.map((content) => {
return {
content,
items: [],
};
}),
};
}
// header mergeImport
mergeImport: (data: string[], blocks) => {
const { level } = blocks[0];
const text = data.join(' ');
const hasSameHeading = level && blocks.every((block) => level === block.level);
if (hasSameHeading) {
return {
text,
level,
};
}
return {
text,
};
},
Nice feature, and something I am after.
This is one of the biggest thing that's missing in this Editor. Thanks for opening this!
Hi, this is also the biggest thing I'm missing in EditorJS.
Is there any update on this feature?
This feature is needed I'm sure by many! Any update on this in future releases?