Skip to content

[Validator] avoid broken rendering of inline types in UniqueEntity #20962

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

Merged
merged 1 commit into from
May 15, 2025

Conversation

santysisi
Copy link
Contributor

@santysisi santysisi commented May 15, 2025

This PR fixes a documentation issue where inline type annotations like | string | were not rendering correctly. This happened because reStructuredText interprets text enclosed in | (e.g., |string|) as a substitution reference, which requires a corresponding definition elsewhere in the document.

Changes
Replaced ambiguous expressions like | string | with clearer wording such as: boolean, string, or array.

Ensures consistent rendering across Sphinx and other reStructuredText parsers.

Why this matters
This change improves the readability of inline documentation and avoids confusion by using a format that renders correctly and doesn't unintentionally trigger reStructuredText substitution rules.

This PR fixes an issue in the documentation where inline type annotations like | ``string`` | were not rendering correctly due to reStructuredText interpreting the | characters as substitution references.

Changes:
Replaced | ``string`` | with a more reliable format: boolean, string or array

Ensures consistent rendering across Sphinx and other reST parsers

This improves readability and avoids confusion when displaying valid type options in inline documentation.
@santysisi santysisi requested a review from xabbuh as a code owner May 15, 2025 01:36
@carsonbot carsonbot added this to the 6.4 milestone May 15, 2025
@OskarStark OskarStark changed the title [Validator] avoid broken rendering of inline types in UniqueEntity [Validator] avoid broken rendering of inline types in UniqueEntity May 15, 2025
@javiereguiluz javiereguiluz merged commit 8f7e04c into symfony:6.4 May 15, 2025
3 checks passed
@javiereguiluz
Copy link
Member

Wow! Very nice catch! I wasn't aware of this at all. Thanks!

I searched in the docs and found another occurrence of this (it didn't happen in 6.4 branch but in upper branches, but I fixed it in 6.4 too: 90e7bf9)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants