-
Notifications
You must be signed in to change notification settings - Fork 4.6k
Docs: Fix line break issue in Schemas and Content Models section #44768
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
Conversation
| will be applied to clean up the pasted content before attempting to match with your block. The schemas are passed | ||
| into [`cleanNodeList` from `@wordpress/dom`](https://github.com/wordpress/gutenberg/blob/trunk/packages/dom/src/dom/clean-node-list.js); check there for | ||
| a [complete description of the schema](https://github.com/wordpress/gutenberg/blob/trunk/packages/dom/src/phrasing-content.js). | ||
| When pasting content it's possible to define a [content model](https://html.spec.whatwg.org/multipage/dom.html#content-models) that will be used to validate and process pasted content. It's often the case that HTML pasted into the editor will contain a mixture of elements that _ should_ transfer as well as elements that _shouldn't_. For example, consider pasting `<span class="time">12:04 pm</span>` into the editor. We want to copy `12:04 pm` and omit the `<span>` and its `class` attribute because those won't carry the same meaning or structure as they originally did from where they were copied. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks for the fix and sorry for the delay: ; looks great and ready to be merged except could you fix the following: _should_ ; (no space between _ and should)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
otherwise, you should be fine; there have been no edits to the file since your PR.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the review 🙌🏻 I have removed the space between _ and should in d7bf196. 🙂
skorasaurus
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you again for the improvement; looks good to me.
|
@skorasaurus Thanks 🙌🏻 May I know who will be merging this PR? 🙂 |
t-hamano
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 👍
Below is a screenshot of this document on GitHub, but since this is a markdown file, normal line breaks are not recognized as line breaks and are displayed correctly.
However, when it was synced to the block editor handbook, this line break was considered a br tag, which might have caused unintended consequences.
Thank you for your great work!
|
@t-hamano Thanks for the explanation 🙌🏻
Understood. Given that this line break was interpreted as a br tag in the block editor handbook, it's possible that there could be more such unintended consequences. Do you think it would be a good idea to have someone review all the relevant documentation to ensure there are no further issues? 🙂 |
|
Thanks to your PR, I can confirm that there are many such cases. However, some documentation is generated from JSDoc comments by the <!-- START TOKEN ... -->
Auto-generated text from JSDoc would go here
<!-- END TOKEN ... -->This case will be fixed in #49635 I put up. For content outside of this token in the markdown file, it should be possible to correct the unnatural line breaks. I would like to put this issue on my task list, but PR from you is also welcome 🙌 |

What is the issue?
There is a line break issue in this documentation as shown in the screenshot below:

What this PR does?
This should fix the line break issues shown in the screenshot below.