5

In the SO editor, the preview for various types of text inside list items does not match the end results.

Take this for instance. It is fine on the screen now, but when you edit...

  1. This is a normal paragraph. Looks OK.

        <p>This is a stacksnippet.
            <span>All but the first line is indented too much.</span>
        </p>

    And this is supposed to be a normal line of text, but it looks like a code block.

Is it possible to correct these problems?

13
  • Remove <!-- language: lang-html --> and the problem seems to go away ... Dec 27, 2015 at 16:01
  • Only for the snippet itself; not for the paragraph following after, that looks like a code block. Also, if the snippet contains CSS, removing the html comment removes the separator between the HTML and CSS blocks.
    – Mr Lister
    Dec 27, 2015 at 16:19
  • The preview tends to be outsync of how markdown gets interpreted down the road, you may have a PR github.com/balpha/pagedown
    – Braiam
    Dec 27, 2015 at 16:20
  • @Braiam Not sure what you mean. What is a PR? What does the link show? And how does it explain the differences between preview and eventual post?
    – Mr Lister
    Dec 27, 2015 at 16:26
  • PR = Pull Request. The source code of the editor, including the previewer. Well, the post html is rendered with the commonmark implementation on server side, while the client side uses pagedown's renderer. This is not novel either, see meta.stackoverflow.com/questions/298409/…
    – Braiam
    Dec 27, 2015 at 16:38
  • @Braiam that is an interesting claim about commonmark. Any (un)official link(s) to support that?
    – rene
    Dec 27, 2015 at 16:59
  • @rene for one the bug I cited reveals that the indentation rules to get pre/code blocks changed to behave as CommonMark specifies. Another would be this very same post.
    – Braiam
    Dec 27, 2015 at 17:02
  • @Braiam I would say that is just a PageDown bug server-side....
    – rene
    Dec 27, 2015 at 17:03
  • @rene PageDown is the client-side editor, based on WDM. Is not used to render the server side of stuff. "While on the Stack Exchange sites PageDown is exclusively used on the client site (on the server side, MarkdownSharp is our friend),"
    – Braiam
    Dec 27, 2015 at 17:12
  • @Braiam Ok, you win, still not commonmark ;)
    – rene
    Dec 27, 2015 at 17:16
  • @rene well, it's consistent with observations, I would say.
    – Braiam
    Dec 27, 2015 at 17:27
  • I'm currently writing a rather lengthy answer that makes heavy use of Stack Snippets in lists, and the live preview is pretty much unusable as a result of this. If I can't trust the editor to preview my answer correctly, I'm not going to be very confident about posting it. (I'd be happy to post my answer without any Stack Snippets as doing so will make it much easier to skim, but someone is going to try and edit them in later and potentially destroy the list formatting in the process.)
    – BoltClock
    Mar 4, 2017 at 6:00
  • Possibly related: Stack Snippets delimiters are being parsed too eagerly
    – BoltClock
    Mar 4, 2017 at 6:01

0

You must log in to answer this question.

Browse other questions tagged .