Skip to content

Custom HTML block adding extra characters #49166

@bradhogan

Description

@bradhogan

Description

Tough to nail down exactly when this occurs, but it seems like it happens any time my Front Page template is saved. I've removed ALL whitespace even and random </p> and <br /> tags are added again and again. Note the odd closing

in this screenshot and random <p> and <br />. Again, I've removed those, then removed the whitespace, saved and it works for the immediate moment, then something happens when I come back and make updates in the Site Editor and the odd characters reappear.

Step-by-step reproduction instructions

  1. Add custom HTML block to a template
<form class="has-text-align-center subscribe-form" action="" data-remote="true"> <input type="text" name="first_name" placeholder="First name..."><input type="email" name="email" placeholder="Your@email">
<div class="ck_control_group ck_captcha2_h_field_group ck-captcha2-h" style="position: absolute !important;left: -999em !important;"><label class="ck_label" for="ck_captcha2_h">We use this field to detect spam bots. If you fill this in, you will be marked as a spammer.</label><input type="text" name="captcha2_h" class="ck-captcha2-h" id="ck_captcha2_h"></div>
<button class="wp-element-button">Join the waitlist</button>
</form>
  1. Save, then logout and log back in, make changes in the Site Editor, save, then go back to edit the template, make changes, exit out, go back and see if the custom html block now has extra tags in there

Screenshots, screen recording, code snippet

Screen Shot 2023-03-17 at 10 40 10 AM

Environment info

  • wp 6.1.1
  • gutenberg 15.3.1
  • chrome
  • mac

Please confirm that you have searched existing issues in the repo.

Yes

Please confirm that you have tested with all plugins deactivated except Gutenberg.

Yes

Metadata

Metadata

Assignees

No one assigned

    Labels

    [Block] HTMLAffects the the HTML Block[Type] BugAn existing feature does not function as intended

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions