Skip to content

Conversation

@imanish003
Copy link
Contributor

What is the issue?

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

What this PR does?

This should fix the line break issues shown in the screenshot below.

@Mamaduka Mamaduka added Needs User Documentation Needs new user documentation [Type] Developer Documentation Documentation for developers and removed Needs User Documentation Needs new user documentation labels Oct 7, 2022
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.
Copy link
Member

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)

Copy link
Member

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.

Copy link
Contributor Author

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. 🙂

@imanish003 imanish003 requested a review from skorasaurus April 3, 2023 09:03
Copy link
Member

@skorasaurus skorasaurus left a 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.

@imanish003
Copy link
Contributor Author

imanish003 commented Apr 4, 2023

@skorasaurus Thanks 🙌🏻 May I know who will be merging this PR? 🙂

@annezazu annezazu enabled auto-merge (squash) April 5, 2023 22:43
@t-hamano t-hamano changed the title Fix line break issue in Schemas and Content Models section Docs: Fix line break issue in Schemas and Content Models section Apr 6, 2023
@t-hamano t-hamano self-requested a review April 6, 2023 03:45
@t-hamano t-hamano disabled auto-merge April 6, 2023 03:50
Copy link
Contributor

@t-hamano t-hamano left a 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!

md

@t-hamano t-hamano merged commit 71acaa6 into WordPress:trunk Apr 6, 2023
@github-actions github-actions bot added this to the Gutenberg 15.6 milestone Apr 6, 2023
@imanish003
Copy link
Contributor Author

@t-hamano Thanks for the explanation 🙌🏻

However, when it was synced to the block editor handbook, this line break was considered a br tag, which might have caused unintended consequences.

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? 🙂

@t-hamano
Copy link
Contributor

t-hamano commented Apr 6, 2023

@imanish003

Thanks to your PR, I can confirm that there are many such cases.

However, some documentation is generated from JSDoc comments by the docgen package. As shown below, the portion surrounded by tokens is automatically generated from JSDoc, so the markdown file can not be updated directly.

<!-- 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 🙌

@imanish003
Copy link
Contributor Author

@t-hamano Thank you for providing a clear explanation! I'm glad to know that the issue is being addressed in #49635. Thanks again for quickly taking care of this 🙌🏻

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

[Type] Developer Documentation Documentation for developers

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants