Skip to content

Conversation

powtac
Copy link

@powtac powtac commented Oct 18, 2023

Adding a space before deep links to avoid this kind of rendering a github icon next to a character.
grafik

Adding a space before deep links.
@powtac
Copy link
Author

powtac commented Oct 18, 2023

It looks like some bot detects a space at a line ending as error. In this case it is not.

Trying to get rid of wrong bot note.
@@ -408,7 +406,7 @@ In some cases, it may make sense for a listener to prevent any other listeners
from being called. In other words, the listener needs to be able to tell
the dispatcher to stop all propagation of the event to future listeners
(i.e. to not notify any more listeners). This can be accomplished from
inside a listener via the
inside a listener via the
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This trailing space should be removed

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Without a space it is rendered wrongly, see screen shot at top.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

By the way, I cannot reproduce this display issue. Which device and which browser do you use?

Remove line break to avoid issue with necessary space before a deep link.
@@ -408,8 +406,7 @@ In some cases, it may make sense for a listener to prevent any other listeners
from being called. In other words, the listener needs to be able to tell
the dispatcher to stop all propagation of the event to future listeners
(i.e. to not notify any more listeners). This can be accomplished from
inside a listener via the
:method:`Symfony\\Contracts\\EventDispatcher\\Event::stopPropagation` method::
inside a listener via the :method:`Symfony\\Contracts\\EventDispatcher\\Event::stopPropagation` method::
Copy link
Contributor

@OskarStark OskarStark Oct 18, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
inside a listener via the :method:`Symfony\\Contracts\\EventDispatcher\\Event::stopPropagation` method::
inside a listener via the
:method:`Symfony\\Contracts\\EventDispatcher\\Event::stopPropagation` method::

should work

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But I think this should be fixed by CC @javiereguiluz

@javiereguiluz
Copy link
Member

I'd say this is a minor bug of the browser used to read the docs.

The content has a white space and it's rendered as expected:

But, when using the max width allowed for the content, the entire link content doesn't fit the space available. In my case, the browser just displays a gap:

I'm not sure we can do anything to fix this 🤔

@wouterj
Copy link
Member

wouterj commented Feb 19, 2024

Thanks of reporting this rendering issue, @powtac!

This bug is reproducible on Firefox, but it indeed appears like something we cannot fix the line break after the GitHub icon. Firefox will line-break in between a pseudo element and the actual content, unless we disable word breaks (but that means that we never line-break within a link, which seems too aggressive to me).

@javiereguiluz you can change the CSS to not use the background-image trick, but instead use the url() function as content (this is valid). This at least fixes the missing whitespace before the icon:

body[data-is-doc-page] .ui-prose a[href^="https://github.com"]::before, body[data-is-doc-page] .page-content .content a[href^="https://github.com"]::before {
  content: url(data:image/svg+xml;utf8;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxNCIgaGVpZ2h0PSIxNCIgZmlsbD0ibm9uZSIgdmlld0JveD0iMCAwIDMyIDMyIj48cGF0aCBmaWxsPSIjMjQyOTJFIiBmaWxsLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik0xNiAwYTE2IDE2IDAgMCAwLTUgMzEuMmMuNy4xIDEtLjQgMS0uOHYtM2MtNCAuOC01LTEtNS40LTEuOC0uMS0uNS0xLTItMS42LTIuMy0uNi0uMy0xLjQtMSAwLTEgMS4yIDAgMi4xIDEuMSAyLjQgMS42IDEuNSAyLjQgMy44IDEuNyA0LjcgMS4zLjEtMSAuNi0xLjcgMS0yLjEtMy41LS40LTcuMy0xLjgtNy4zLTggMC0xLjcuNy0zLjEgMS43LTQuMi0uMi0uNC0uNy0yIC4xLTQuMyAwIDAgMS40LS40IDQuNCAxLjdhMTQuOCAxNC44IDAgMCAxIDggMGMzLjEtMi4xIDQuNC0xLjcgNC40LTEuNyAxIDIuMi40IDMuOS4yIDQuM2E2IDYgMCAwIDEgMS42IDQuM2MwIDYuMS0zLjcgNy41LTcuMyA3LjkuNi41IDEuMSAxLjQgMS4xIDN2NC4zYzAgLjQuMyAxIDEuMS44QTE2IDE2IDAgMCAwIDE2IDBaIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiLz48L3N2Zz4=);
  margin-right: .25em; /* 1/4th em is roughly the size of a normal space character */
}

I prefer this over adding trailing whitespaces before links throughout the documentation sources.

@javiereguiluz
Copy link
Member

@wouterj I'm really sorry that I lost track of your last comment. I just found this and did that change on symfony.com.

Link icons now work as expected on all browsers, Firefox included. Thanks a lot!

Let's close this one as fixed.

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.

6 participants