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

Nofollow option in a button link block adds unnecessary space before the attribute #66300

Closed
franzaurus opened this issue Oct 22, 2024 · 1 comment · Fixed by #66303
Closed
Assignees
Labels
[Block] Buttons Affects the Buttons Block [Status] In Progress Tracking issues with work in progress

Comments

@franzaurus
Copy link
Contributor

As reported here.

When users add a link in the button block and mark it as nofollow, the resulting HTML comment adds unnecessary space before the attribute.

Steps to reproduce

  1. Add a button block and insert a link
  2. Edit the link and check the mark as nofollow option
  3. View the resulting HTML code via the Code editor
  4. OR inspect the button element via the browser
  5. Notice the link's rel=" nofollow" attribute has space before the string

I've checked some other blocks that have "rel" attribute enabled (e.g. custom link, social icons, title, featured image, image, media, and text) with the help of this list and found that it only affects the button block.

As a workaround, users can edit the button instances via the code editor view and make the necessary edits to the HTML code there.

Environment
Studio, Local
WP 6.6.2 with/without Gutenberg 19.4.0
WP 6.7-beta3 without Gutenberg

Image

@vipul0425
Copy link
Contributor

Hi @franzaurus, Thanks for reporting this.
It seems like when there was no rel value set from the buttons advance settings then also it was appending space before the link nofollow value. Added a PR to fix this issue.

@hbhalodia hbhalodia added the [Block] Buttons Affects the Buttons Block label Oct 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Block] Buttons Affects the Buttons Block [Status] In Progress Tracking issues with work in progress
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants