SocialLinksPattern drops list item text outside the links, and counts every mailto: as a social service
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 52/100
Research direction
Start by reading SocialLinksPattern, especially the list conversion, service() and isSocialCluster() paths; the issue names no file path or test. Reproduce with the Markdown or HTML reduction in the issue, then check cases with text beside links and lists containing only mailto: links. Done means those cases preserve list text and mail-only lists are not converted to social links.
Written by the indexing model from the issue text.
Description
Summary
When SocialLinksPattern accepts a ul/ol as a social cluster, it builds core/social-link blocks from the anchors and discards everything else in the list items. Any text beside the links is silently lost. And because service() returns mail for every mailto: URL, isSocialCluster() accepts any list of two or more items that each contain an email address.
Seen in php-transformer v0.27.0, through FormatBridge with Markdown input (GFM to HTML first). The result was real data loss in a knowledge base entry: a history list became two mail social links, and the history lines were gone.
Reduction
Markdown:
- <[email protected]>
- 16 Nov: replied <[email protected]>
or the equivalent HTML:
<ul>
<li><a href="mailto:[email protected]">[email protected]</a></li>
<li>16 Nov: replied <a href="mailto:[email protected]">[email protected]</a></li>
</ul>
Output (v0.27.0):
<!-- wp:social-links {"showLabels":true,"className":"blocks-engine-source-social-item-spacing"} -->
<ul class="wp-block-social-links has-visible-labels blocks-engine-source-social-item-spacing">
<!-- wp:social-link {"url":"mailto:[email protected]","service":"mail","label":"[email protected]"} /-->
<!-- wp:social-link {"url":"mailto:[email protected]","service":"mail","label":"[email protected]"} /-->
</ul>
<!-- /wp:social-links -->
The 16 Nov: replied text is gone. A list with social hosts behaves the same way (- Code on [GitHub](https://github.com/x) / - Toots on [Mastodon](https://mastodon.social/@x) loses "Code on" and "Toots on").
Relation to #5979
#5979 (closed) stops text-labelled links to social hosts being treated as icons, which may cover the reductions above in a newer release. But the underlying data loss remains for any list the pattern does accept, for example icon links or an explicitly named .social list whose items also hold other text.
Expected
- A list whose items hold text outside their links is never lowered to
core/social-links(or the pattern declines and the list converts ascore/list). Social links can't hold that text, so accepting the list loses content. - A cluster made only of
mailto:links isn't treated as social on its own. Email addresses are ordinary content far more often than a social-icon row. - If text must be dropped, it should at least be reported as a fallback rather than lost silently.
Workaround downstream
In LH Content Converter we now hide http/https/mailto hrefs inside lists from the transformer for Markdown input (placeholder URLs on .invalid) and restore them afterwards. We'll drop that once this is fixed.
AI disclosure: diagnosed and filed with Claude (Anthropic) via the LocalHero MCP tooling, reproduced against the live converter.
- Dominant language
- PHP
- Stars
- 28
- Forks
- 5
- Avg merge
- 2h 59m
- Merged PRs (30d)
- 942
Getting set up
- No Dockerfile or Docker Compose file
- No pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from Automattic/blocks-engine
-
Difficulty 2/5 1-3 hours Newbie friendliness 79/100
Automattic/blocks-engine#6318 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
Automattic/blocks-engine#4943 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
Automattic/blocks-engine#4942 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
Automattic/blocks-engine#4921 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
Automattic/blocks-engine#775 ·
Maintainers usually reply within 1 day
All issues in Automattic/blocks-engine
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
TYPO3-Solr/ext-solr#4850 ·
Maintainers usually reply within 2 days
-
[Sync EN] stream: document the errors of the stream_context_*() and stream filter functions (#6091)Opensync-en
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 1 day
-
[Sync EN] stream: document the errors of the stream_context_*() and stream filter functions (#6091)Opensync-en
Difficulty 2/5 1-3 hours Newbie friendliness 66/100
Maintainers usually reply within 1 day
-
Перевод устарел
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
glpi-project/glpi#26353 · 2 comments ·
Maintainers usually reply within 1 day