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

Text: handle legacy structures #589

Closed
mtias opened this issue May 1, 2017 · 12 comments
Closed

Text: handle legacy structures #589

mtias opened this issue May 1, 2017 · 12 comments
Assignees
Labels
[Feature] Blocks Overall functionality of blocks [Type] Task Issues or PRs that have been broken down into an individual action to take

Comments

@mtias
Copy link
Member

mtias commented May 1, 2017

Input could be any of:

// Just text
Some text

// With p tags
<p>Some text</p>

// With comment tags
<!-- wp:core/text --><p>Some text</p><!-- /wp:core/text -->

Output is only one.

@mtias mtias added [Feature] Blocks Overall functionality of blocks [Type] Task Issues or PRs that have been broken down into an individual action to take labels May 1, 2017
@nylen
Copy link
Member

nylen commented May 1, 2017

This implies that loading a post and saving it will rewrite content into our "expected" form. I think we should avoid this rewriting as much as possible.

@mtias
Copy link
Member Author

mtias commented May 1, 2017

Not necessarily, I think we need the mechanism in the API, whether it's enabled by default and in which contexts, is a separate discussion altogether.

@jasmussen jasmussen modified the milestone: Beta Jun 5, 2017
@ellatrix
Copy link
Member

ellatrix commented Jun 7, 2017

At some point, I think it was discussed that we shouldn't use delimiters for text blocks. It sounds like that would automatically make it compatible with old paragraphs?

@ellatrix
Copy link
Member

ellatrix commented Jun 7, 2017

So it sounds like the in and output should be

<p style="text-align:center;" class="...">Some text</p>

where the attributes are part of the HTML? As soon as it's so other format, we let it be freeform? Or do we want to use the delimiters when there are attributes, and leave them out if there is nothing?

I also sounds like we want to upgrade just text without any HTML tags.

@dmsnell
Copy link
Member

dmsnell commented Jun 7, 2017

the in and output should be

I see the in. 😄

would you propose that the output be like this?

{
	name: 'core/text',
	content: [
		<p style="text-align:center;" class="...">Some text</p>
	]
}

@ellatrix
Copy link
Member

ellatrix commented Jun 7, 2017 via email

@dmsnell
Copy link
Member

dmsnell commented Jun 7, 2017

I spoke with @mtias about possibly adding a new core/soup block type which is nothing more than "non-bock content outside of proper block boundaries" by the way. this could be related here.

@BE-Webdesign
Copy link
Contributor

nothing more than "non-bock content outside of proper block boundaries" by the way. this could be related here.

My interpretation of the free form block, or whatever it ends up being named, is that it is solving that niche. What does the free form block do differently than a soup block?

@dmsnell
Copy link
Member

dmsnell commented Jun 7, 2017

What does the free form block do differently than a soup block?

It indicates that we had out-of-block content. Whereas the freeform block lives within block boundaries and can carry the additional assertions as a result, soup is just there and we're not entirely sure why. We can try to make assumptions but we have no ground on which to stand them.

@BE-Webdesign
Copy link
Contributor

BE-Webdesign commented Jun 7, 2017

I think reading through the context of this issue, I understand maybe a bit better. I would second nylen's comment, and add onto that a bit. I don't think it is necessary to translate "legacy" content into block content. The coolness factor is very high and I like the concept, but I am not sold on what practical benefit that brings to the table. I see Gutenberg as more of a progressive enhancement on top of the current editor experience. What benefit does translating the arbitrary HTML to blocks bring? It is also kind of prescribing somehow that we know the intent of the content. People use <p> tags for all sorts of stuff that is not text.

@ellatrix
Copy link
Member

ellatrix commented Jun 22, 2017

Older PR: #413 "Propose block APIs for backwards compatibility"

@ellatrix
Copy link
Member

@mtias Is this still relevant now? :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Feature] Blocks Overall functionality of blocks [Type] Task Issues or PRs that have been broken down into an individual action to take
Projects
None yet
Development

No branches or pull requests

6 participants