nozer/quill-delta-to-html

Custom inline blot missed by renderCustomWith()

Closed this issue · 4 comments

There is a simple example of extending Quill with mark tag support like so:

class MarkBlot extends Quill.import('blots/inline') { } 
MarkBlot.blotName = 'mark';
MarkBlot.tagName = 'mark'; 
Quill.register(MarkBlot);

It can make Quill produce a delta like:
{"ops":[{"attributes":{"mark":true},"insert":"q"},{"insert":"\n"}]}

Then in accordance with your guide a do:

converter.renderCustomWith((customOp, contextOp) =>
	customOp.insert.type === 'mark' ?
		`<mark>${customOp.insert.value.text}</mark>`
		: 'Unmanaged custom blot!';

But passed function doesn't even called!
What's wrong?

renderCustomWith works only for embed blots (

@volser But EmbedBlot is an abstraction of Parchment as Quilljs data model. Quill-delta-to-html works with Delta which has no relation to Parchment by itself.

Does Quill-delta-to-html depend on Parchment somehow?

And I know it's related to #55 (comment)
But I do not know how to make Quill create custom op instead of attribute. And I doubt it's right way to fix the flaw. In the end quill-delta-to-html already implements expected mechanism for strong and emfisize attributes/elements and so on. We need only inject a custom value.

pushed version with new features