contentful/rich-text
PHP library for parsing and rendering Contentful Rich Text fields. Parses localized rich text JSON into node objects, resolves linked assets/entries via a link resolver, and renders nodes to output with a simple Renderer API. Requires PHP 7.2+ / 8.0+.
ParserInterface and NodeMapperInterface - any implementation using a custom parser or NodeMapper will need to update the entries accordingly. Additionally, the ParserInterface::parse() and ParserInterface::parseCollection() methods have been deprecated in favor of their localized version (ParserInterface::parseLocalized() and ParserInterface::parseCollectionLocalized(), respectively).EmbeddedAssetBlock and EmbeddedAssetInline (see #61).Added support for rich text tables
Drop MapperException and let the code simply throw the exception in the same form it was raised.
Added support for PHP 7.4. Removed support for PHP 7.0 & 7.1. Updated dependencies.
embedded-entry-inline and embedded-asset-inline nodes.contentful-core.php required strictly version 2.0.0, now it was fixed to allow for all v2 versions.Parser::setNodeMapper(string $nodeType, NodeMapperInterface $nodeMapper) was added, now it's possible to define custom mappers after the parser's creation.Nothing has been implemented, which is used as a replacement for when creating other nodes does not succeed (e.g. a link can't be resolved).EmbeddedAssetBlock has been implemented.AssetHyperlink now expects an object implementing AssetInterface instead of ResourceInterface. [BREAKING]EmbeddedEntryBlock and EntryHyperlink now expects an object implementing EntryInterface instead of ResourceInterface. [BREAKING]getNodeClass was removed from NodeInterface. [BREAKING]Quote was renamed Blockquote. [BREAKING]contentful/structured-text-renderer to contentful/rich-text. [BREAKING]Contentful\StructuredText\NodeRenderer\CatchAll can be used to avoid having the main renderer throw an exception in the event of an unsupported node. Use it like this:
$renderer = new Contentful\StructuredText\Renderer();
$renderer->appendNodeRenderer(new Contentful\StructuredText\NodeRenderer\CatchAll());
It's important to use the appendNodeRenderer method to make the main renderer use it as last resort, otherwise, it will intercept all calls to other nodes.NodeInterface now includes method getNodeClass, for exposing whether a node is of type block or inline.How can I help you explore Laravel packages today?