Indenting paragraph in HTML view causes an error
Describe the bug
Using <p style="padding-left: 30px;"> in a block causes an error message
To Reproduce Steps to reproduce the behavior:
- Create a new text block.
- Choose to edit it in HTML format.
- Enter the following in the block:
<p style="padding-left: 30px;">This is a paragraph to be indented.</p>
4: Click the three dots to open the dialog to switch to visual editing mode.
Expected behavior The block is shown visually.
Observed behavior The error "This block contains unexpected or invalid content" is shown. (In Finnish in the screensot below)
Screenshots
The error message:

When selecting "Ratkaise" (=Resolve) the following is @shown:

Desktop (please complete the following information):
- OS: Windows 7
- Browser: Opera
- Browser version: 58
- WordPress version: 5.1.1
@swissspidy
We really need the ability to indent natively in Gutenberg. This is a very important feature for many.
Let's close this in favor of #14554.
Getting a validation error after changing a block's expected markup is intended behavior.
@swissspidy, I would like to know in what way
<p style="padding-left: 30px;"> </p>
is non-expected. It is, after all (as far as I know) valid HTML.
In addition, after resolving the error so that the desired indentation is maintained (ie, by converting the block to HTML), editing the block is cumbersome, as it can only be edited in HTML format, not graphically.
Block validation is not simply a matter of verifying that the contents are valid HTML. The paragraph block cannot support this style attribute. The message is shown because it otherwise risks content loss (it can't handle the style, and thus it would be removed next time a save occurs).
There are pending discussion for ideas in improving block invalidation at #7604.
Based on how the paragraph block works, I suspect you may find some luck with the following variation:
<p><span style="padding-left: 40px;"></span>Hello</p>
Alas, that seems to indent only the first line, not the entire paragraph as required. And it, too, invokes the error dialog.
pe 29. maalisk. 2019 klo 14.38 Andrew Duthie ([email protected]) kirjoitti:
Block validation is not simply a matter of verifying that the contents are valid HTML. The paragraph block cannot support this style attribute. The message is shown because it otherwise risks content loss (it can't handle the style, and thus it would be removed next time a save occurs).
There are pending discussion for ideas in improving block invalidation at #7604 https://github.com/WordPress/gutenberg/issues/7604.
Based on how the paragraph block works, I suspect you may find some luck with the following variation:
Hello
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/WordPress/gutenberg/issues/14672#issuecomment-477982882, or mute the thread https://github.com/notifications/unsubscribe-auth/AsEEIcE8LNF6TDyEDRDonnr5wM2k_O3Xks5vbglbgaJpZM4cPG0i .
@vesaraiskila If you are still looking for a way to indent Paragraph on Gutenberg editor, you can use EditorsKit plugin. I've recently added Indent and Outdent Formats. Here's how it works. Thanks!
