Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for text / content (html children) #5

Open
DamChtlv opened this issue Jan 31, 2024 · 1 comment
Open

Add support for text / content (html children) #5

DamChtlv opened this issue Jan 31, 2024 · 1 comment

Comments

@DamChtlv
Copy link

Thank you

To begin, awesome tool!
Really useful, thanks for that :)

Issue

Is it possible to add support for text / content attributes?
For example, a paragraph block contains this:

<!-- wp:paragraph {"fontSize":"texte-1"} -->
<p class="has-texte-1-font-size"><strong>Description. Lorem ipsum dolor sit amet consectetur. Faucibus sagittis varius at mattis malesuada venenatis. Facilisis id consequat nulla eget fusce tristique aenean tellus.</strong></p>
<!-- /wp:paragraph -->

Solution

It can be converted in PHP like so:

array(
    'core/paragraph',
    array(
        'fontSize' => 'texte-1',
        'content' => '<strong>Description. Lorem ipsum dolor sit amet consectetur. Faucibus sagittis varius at mattis malesuada venenatis. Facilisis id consequat nulla eget fusce tristique aenean tellus.</strong>',
    ),
    array()
),
@DamChtlv
Copy link
Author

Added a fix in this pull request: #6
Hope the owner sees it :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant