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

Social Links: Don't prepend URL fragments #68655

Open
wants to merge 1 commit into
base: trunk
Choose a base branch
from

Conversation

Mamaduka
Copy link
Member

@Mamaduka Mamaduka commented Jan 14, 2025

What?

This is a follow-up to #42167.
PR of #55543 (comment).

PR updates logic in Social Links rendered and avoids prepending URL fragments with https://.

Why?

The fragments are valid URLs often used as placeholders for Social Icons. They can also refer to social sections on a website.

Testing Instructions

  1. Open a Post or Page
  2. Insert the example block (snippet below).
  3. Save and view the post.
  4. On the front end, inspect block elements and confirm that the Instagram fragment has no https:// prefix.
  5. Confirm that other links are rendered correctly.
Social Links example

<!-- wp:social-links -->
<ul class="wp-block-social-links"><!-- wp:social-link {"url":"//twitter.com/WordPress","service":"twitter"} /-->
<!-- wp:social-link {"url":"profiles.wordpress.org/wordpress/","service":"wordpress"} /-->
<!-- wp:social-link {"url":"http://github.com/WordPress","service":"github"} /-->
<!-- wp:social-link {"url":"#instagram","service":"instagram"} /--></ul>
<!-- /wp:social-links -->

Testing Instructions for Keyboard

Same.

Screenshots or screencast

@Mamaduka Mamaduka added [Type] Bug An existing feature does not function as intended [Block] Social Affects the Social Block - used to display Social Media accounts labels Jan 14, 2025
@Mamaduka Mamaduka self-assigned this Jan 14, 2025
Copy link

The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the props-bot label.

If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.

Co-authored-by: Mamaduka <mamaduka@git.wordpress.org>

To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook.

Copy link

Flaky tests detected in 7d7c7f4.
Some tests passed with failed attempts. The failures may not be related to this commit but are still reported for visibility. See the documentation for more information.

🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/12764706932
📝 Reported issues:

@Mamaduka Mamaduka added the Good First Review A PR that's suitable for someone looking to contribute for the first time by reviewing code label Jan 14, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Block] Social Affects the Social Block - used to display Social Media accounts Good First Review A PR that's suitable for someone looking to contribute for the first time by reviewing code [Type] Bug An existing feature does not function as intended
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant