-
Notifications
You must be signed in to change notification settings - Fork 40
t/ckeditor5/1514: Created a guide with solutions for common conversion problems reported by the users #1677
Conversation
More ideas – there are some really cool examples in https://github.com/ckeditor/ckeditor5-core/blob/poc/catch-all-converters/tests/manual/converters.js and https://github.com/ckeditor/ckeditor5-core/blob/poc/catch-all-converters/tests/manual/converters.html. We need to add them to the list :) Also... we need tests for the converters in these samples :((( But I have an idea how to do that ;> |
I'll add those to the PR. |
The same thing as d370243 may be necessary for other snippets too. They work without it but it could be an accident that during |
} | ||
} ) | ||
.then( editor => { | ||
window.editor = editor; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like we copy-paste a lot :)
Shouldn't we namespace those somehow? Right now the last snippet executed on the page "wins".
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah. Probably window.editors = { ... }
.
One more case to cover: divs with classes: editor.model.schema.register( 'div', {
allowWhere: '$block',
allowContentOf: '$block', // May also be `$root` if it's supposed to behave as a wrapper.
allowAttributes: 'class'
} );
// Model-to-view convert for the div element (attrbiutes are converted separately).
editor.conversion.elementToElement( {
model: 'div',
view: 'div'
} );
editor.conversion.attributeToAttribute( {
model: { name: 'div', key: 'class' },
view: 'class'
} ); |
Also, we actually have to review many of those examples now because of link decorators. I wouldn't necessary remove them, but explain that this can also be achieved with that feature. |
I've added:
Examples cross-linked to the link decorators:
The code works AFAICS and the examples are still relevant but some of them are already implemented as link decoreators so we might think in the future to rewrite them to similar cases but withouth using Still the whole guide is just needed to be published IMO :) |
Great job, @jodator! Thanks! I guess we still have some things that we could add to this guide. We've been doing some PoC's in ckeditor5-core, e.g. Could you also open a followup ticket with links to those and some other ideas that we posted here or that come to your head? You've been implementing many strange cases for our customers, so there must be something :D |
@Reinmar most of the ideas from this PR and a ticket are implemented in the guide. Anyway, the follow up is here: https://github.com/ckeditor/ckeditor5-engine/issues/1761 as I couldn't find more ideas. |
docs/_snippets/framework/extending-content-arbitrary-attribute-values.js
Outdated
Show resolved
Hide resolved
docs/_snippets/framework/extending-content-custom-figure-attributes.js
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All the imports (Font, Plugin, Code) need to be moved to build-extending-content-source.js and exposed there.
6th attempt at reviewing this :D |
OK, I admit I didn't check the code samples themselves but rather focused on gluing together some intro and making this guide easier to follow by splitting it. Let's just polish it with time. Anyway, thanks for all the content guys. Lots of valuable information will finally be available to the people. |
Suggested merge commit message (convention)
Docs: Created a guide with solutions for common conversion problems reported by the users. Closes ckeditor/ckeditor5#1514.
Additional information
Requires ckeditor/ckeditor5#1520 to get the link UI working in the examples upon clicking a link.
Some comments