2

In my question here, I tried to paste code using the triple-backtick syntax. However, when I did that, the backticks appeared to be treated as just ordinary text:

``` MockMvc mvc = MockMvcBuilders.webAppContextSetup(ctx) .apply(SecurityMockMvcConfigurers.springSecurity()) .build()

HtmlUnitDriver driver = MockMvcHtmlUnitDriverBuilder.mockMvcSetup(mvc).javascriptEnabled(true).build() ```

This issue appears to be triggered if there are any blank-after-trim lines in the code block.

edit: In response to Martijn's answer that "they're not supported", they do work partially:

This is in code formatting.

1
  • 2
    The don't really work "partially", and you shouldn't try to use them that way. You're getting inline formatting identical to use of single backticks. When you type ```abc```, you're getting one empty inline block for the first ``, then one inline block containing `abc`, then one more empty inline block ``. This is identical to just using `abc` or `````abc````` or ```````abc```````. So long as you have an odd number of `'s, the leading and trailing ones are redundant and have no effect
    – user229044 Mod
    Commented Sep 13, 2016 at 17:49

1 Answer 1

9

Your format works for me:

MockMvc mvc = MockMvcBuilders.webAppContextSetup(ctx)
    .apply(SecurityMockMvcConfigurers.springSecurity())
    .build()

HtmlUnitDriver driver = MockMvcHtmlUnitDriverBuilder.mockMvcSetup(mvc).javascriptEnabled(true).build()

This is only because this type of format was just recently introduced. Very recently. In other words, .

All posts are cached, so you will need to make a minor edit to make the formatting work on posts that existed before this feature was implemented.

2
  • @usr2564301 Like I said, posts are cached, which means that it doesn't recalculate the HTML until the post is edited.
    – Laurel
    Commented Jan 8, 2019 at 22:42
  • 2
    @usr2564301 Given the amount of content on Stack Overflow, things don't always get fixed soon after posting. And some things only get fixed partially. For example, here is a random post from 2017 that was trying to use code fences.
    – Laurel
    Commented Jan 8, 2019 at 22:50

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .