Repository navigation
Conversation
video_block yielded the YouTube block and then fell through to the plain video block, so every <video> with a YouTube src produced two identical video blocks. The tests only looked at the first block, so they never saw the second one. Refs #49
The endpoints are annotated with the VoltoBlock TypedDict, and pydantic dropped every key it does not declare: the table of a slateTable, the src, width and height of an iframe, the alt and title of an image. Allow extra keys through __pydantic_config__, set as a plain dict so that pydantic stays an optional dependency of the package. Refs #49
Block converters and iframe providers now declare the Volto block type they produce, the frontend package that provides it, whether it is enabled by default, its options (a dataclass) and an optional fallback. Every existing registration got its metadata: image, slateTable, video, codeBlock, slate, iframe and soundcloudBlock. One blocks setting, keyed by block type, enables, disables and configures them: blocks= in html_to_blocks(), markdown_to_blocks() and volto_blocks(), --enable, --disable and --option in the convert command, and a blocks field on POST /html, /markdown and /volto. Unknown block types and options, and values of the wrong type, are errors. The setting replaces the code_block argument and the --code-* options added for codeBlock, which were never released. A disabled block type sends its tags to its fallback, or hides them as the codeBlock converter did. An iframe whose provider block is disabled goes to the default provider, and is dropped when that one is disabled too. The new html2blocks blocks command (text, JSON or Markdown), GET /blocks and the info command report the block types. The Markdown output is the Supported blocks reference page, regenerated with make docs-blocks, and a test fails when the page is out of date. The table converter now takes the tags to extract from cells from the registry, so a <pre> inside a table comes after the table, like images and videos, while codeBlock is enabled. Closes #49
Add two iframe providers, both producing Volto core blocks: - Google Maps (www.google.com/maps/embed and maps.google.com/maps) becomes a maps block, with the iframe src as its url and the iframe title, if any. - Vimeo (player.vimeo.com/video/<id> and vimeo.com/<id>) becomes a video block. The video block reads the Vimeo id from what follows ".com/", so the url is always https://vimeo.com/<id>, never the player URL. Disabling maps or video sends these iframes to the default iframe provider. Refs #49
A YouTube <iframe> becomes a video block with https://youtu.be/<id>, but a <video> with a YouTube src kept its original URL (watch?v=, embed/...). Use the same URL for both. Refs #49
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Every block converter now declares the Volto block type it produces, and one
blockssetting turns each type on or off and sets its options. This replaces the code-block-specific plumbing from #48, so the next opt-in block needs no new parameters or flags.html2blocks convert --enable codeBlock --option codeBlock.style=light --disable slateTable …blocksfield onPOST /html,/markdownand/volto. An invalid setting returns 400.html2blocks blocks(text/JSON/Markdown),GET /blocks, and a new block-types section ininfo. The docs page Supported blocks is generated withmake docs-blocks, and a test fails when it goes stale.code_block=and the--code-*flags from Convert <pre> and Markdown code fences to code blocks #48 are removed. They were never released.Registrations
slate@plone/voltoimage<img>@plone/voltoslateTable<table>@plone/voltovideo<video>, YouTube and Vimeo<iframe>@plone/voltomaps(new)<iframe>@plone/voltoiframe<iframe>@kitconcept/volto-iframe-blocksoundcloudBlock<iframe>@kitconcept/volto-social-blockscodeBlock<pre>@plonegovbr/volto-code-blockiframeandsoundcloudBlockcome from add-ons but stay on, so the default output doesn't change. While there are no fallbacks for disabledimage,videoandiframeblocks, disabling them drops the element.Bugs fixed along the way
<video>produced twovideoblocks, and kept itswatch?v=URL instead ofyoutu.be/<id>.VoltoBlockdoesn't declare: thetableof a table, thesrcof an iframe, thealt/titleof an image.codeBlockon, a<pre>inside a table came out before the table instead of after it.Default output was compared against a snapshot of 298 cases taken from the fixtures, and only the YouTube
<video>cases changed.Closes #49