Skip to content

Updated literal blocks to improve word breaking #77

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 2 commits into from
Mar 18, 2021

Conversation

javiereguiluz
Copy link
Collaborator

@javiereguiluz javiereguiluz commented Mar 18, 2021

In Symfony Docs is very common to have long PHP namespaces as <code> elements.

Firefox is the smartest browser and can break them by the backslash:

firefox-default

However, Chrome and others don't do that, so the result is large and ugly gaps in the text:

chrome-default

This PR proposes a trick to add <wbr> tags in some cases to help browsers. These <wbr> are completely transparent to users and they don't appear even if you copy+paste the text.

After this PR, Chrome looks like this:

chrome-with-wbr

@weaverryan weaverryan merged commit 82a2fa3 into symfony-tools:master Mar 18, 2021
@weaverryan
Copy link
Contributor

Absolutely gorgeous!

@javiereguiluz javiereguiluz deleted the code_tweak branch March 19, 2021 17:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

3 participants