-
-
Notifications
You must be signed in to change notification settings - Fork 5.2k
CSS issue in rendered documentation with diff code #14472
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
Comments
Thank you Jérémy, I assigned this issue to Javier 👍 |
The problem, as usual with Sphinx, is that if we fix this, we break other things. Check out for example the Here's the comparison of the current CSS and the result of removing the
The problem is that the |
@javiereguiluz I think it's because we incorrectly indent the code in the Symfony docs. Each line that doesn't start with bad .. code-block:: diff
// src/Controller/LuckyController.php
// ...
+ use Symfony\Component\Routing\Annotation\Route;
class LuckyController
{
+ /**
+ * @Route("/lucky/number")
+ */
public function number()
{
// this looks exactly the same
}
} correct .. code-block:: diff
// src/Controller/LuckyController.php
// ...
+ use Symfony\Component\Routing\Annotation\Route;
class LuckyController
{
+ /**
+ * @Route("/lucky/number")
+ */
public function number()
{
// this looks exactly the same
}
} |
Oh no! All our diffs are wrong? It will take a lot of time to fix everything from 4.4 to 5.x and upmerge and fix all conflicts. 😢 |
@javiereguiluz I'll check this weekend if I can (a) write a DOCtor rule and (b) can automate the fix. If that doesn't take much time, we can fix it quickly. |
I wonder if this is solvable... In the diff format, the not-changed line should start with a space. In that case, I wonder if Sphinx is able to detect the extra space from the indentation?. ie:
|
@jderusse good point! I think this is why all diffs normally should start with a |
What could we do here? Is this solvable in an automated way? Thanks! |
Closing as fixed by #15009. |
Hello,
The documentation on Symfony has a CSS bug in rendering diff.
This is more visible on the fast track https://symfony.com/doc/current/the-fast-track/en/6-controller.html#adding-an-easter-egg
The issue is the
.highlight-diff .highlight>pre
has apadding-left: 1.5em
But the
.highlight-diff .gd
and.highlight-diff .gi
(used to display-
and+
) have apadding-left: 1px
+margin-left: -15px
.Maybe this is because the documentation indent diff with spaces (https://github.com/symfony/symfony-docs/blame/5.x/http_cache.rst#L98-L99) ?

But the render is not perfect
From my tests, using a
margin: -1.2em; pading: 0
but maybe it vary on browser and OS?The text was updated successfully, but these errors were encountered: