getsentry / sentry-docs

Sentry's documentation (and tools to build it)
https://docs.sentry.io
Other
328 stars 1.43k forks source link

Diff code blocks have different padding from normal code blocks #10510

Closed szokeasaurusrex closed 1 month ago

szokeasaurusrex commented 3 months ago

Steps to Reproduce

  1. Create a normal code block on a docs page, for example:
    ```python
    def hello_world():
    print("hello_world")

hello_world() print("done")

</pre>

2. Create a diff code block on a docs page, for example:
<pre>
```python diff
def hello_world():
-     print("hello_world")
+     print("Hello, world!")

hello_world()
- print("done")
+ print("Done!")

Expected Result

Both code blocks have the same padding

Actual Result

The blocks have different padding. This example, which is the rendered preview of #10508, demonstrates the problem.

Additional Info

No response

a-hariti commented 3 months ago

I believe the ideal should be one extra column on the left (a space or +/-) with the same padding as normal code

wyt @szokeasaurusrex?

a-hariti commented 3 months ago

this code block:

 def hello_world():
+    print("hello_world")
-    print("Hello, world!")

produces:

Screenshot 2024-06-28 at 12 30 37

which is inline with a non diff code block

normal code blocks

Screenshot 2024-06-28 at 12 33 02