8

I'm using Google Chrome on Android 10 - Samsung Galaxy A30s.

When looking at this question

enter image description here

We can see the first code block has a specific indentation. Then, when clicking to edit

enter image description here

The expected result looks better (the ngOnInit appears closer to the edge than it really is).


Edit

Now when going through different answers in Google Chrome on my Windows 10 machine, found this answer with similar problem in the code.

When looking at the real answer there's an extra empty paragraph in the code

enter image description here

When we're editing, the expected result looks like this (it doesn't have that extra paragraph)

enter image description here

10
  • 1
    It's a snippet, not normal code. That's the border width used on a Stack Snippet. Dec 3, 2020 at 8:43
  • @CodyGray Is it normal being different in both sides? Dec 3, 2020 at 8:44
  • That makes it harder to edit to the proper format if the expected result doesn't really match the reality Dec 3, 2020 at 8:45
  • 1
    I think it is caused (in some way) by the over-indented code (it has 6 spaces before it, while the HTML part of the snippet is indented with 4 and renders correctly).
    – FZs
    Dec 3, 2020 at 8:49
  • 2
    @FZs sure but interesting how in one place the spaces are picked up and in the other no Dec 3, 2020 at 8:50
  • 5
    Bugs are often... strange.
    – FZs
    Dec 3, 2020 at 9:38
  • 1
    Confirmed (Firefox 83.0 on Ubuntu MATE 20.04) (Focal Fossa)). The problem disappears if the extra 2 spaces indent in the first snippet is removed (and it is not caused by the extra 4 spaces on a separate line before the snippets). Dec 7, 2020 at 11:22
  • 1
    Using 2 extra spaces indent (divisible by 4, for a total of 8 spaces indent) does not help - the first line, ngOnInit() {, is still not indented in the preview. Dec 7, 2020 at 11:28
  • 1
    I ran into a similar problem with syntax highlighting of the first line (in this Stack Overflow question). Using "```lang-html" instead of 4 space indent was a way to fix it. Is there a corresponding meta question? Dec 31, 2020 at 16:05
  • @PeterMortensen not that I know of. Not sure if it'd really make sense since it's shown only in SO Dec 31, 2020 at 17:01

0

You must log in to answer this question.

Browse other questions tagged .