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

[GHS] custom elements #11744

Merged
merged 15 commits into from
May 31, 2022
Merged

[GHS] custom elements #11744

merged 15 commits into from
May 31, 2022

Conversation

niegowski
Copy link
Contributor

@niegowski niegowski commented May 11, 2022

Suggested merge commit message (convention)

Feature (html-support): Custom elements should be preserved by GHS. Closes #11432.

Fix (engine): Whitespaces between block elements should not trigger auto-paragraphing. Closes #11248.


Additional information

@@ -465,6 +465,11 @@ export function convertText() {
return;
}

// Do not auto-paragraph whitespaces.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This breaks the following test:

it( 'nbsp between blocks is not ignored (between paragraphs)', () => {

We need to choose to either trim that nbsp in that case or correctly handle scenarios like:

<custom>x</custom>

<custom someattr></custom>

where the space (normal space) should be trimmed.

Unfortunately, since these are custom elements we can't easily make the decision on DOM->view conversion whether these are spaces between block or inline elements.

Additionally, unfortunately we lose the information whether this was an nbsp or normal space upon DOM->view conversion. Currently, all are normalized to normal spaces at this stage. if they weren't, the below code would actually correctly differentiate these situation.

Hence, we need to:

  • either lose intentional nbsps between blocks (may happen in HTML generated by external tools)
  • or make sure custom elements don't break things

@niegowski niegowski marked this pull request as ready for review May 25, 2022 10:48
Copy link
Member

@oleq oleq left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes.

@oleq oleq merged commit efd6f84 into master May 31, 2022
@oleq oleq deleted the ck/11432-ghs-custom-elements branch May 31, 2022 14:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants