11

I recently posted a question to Code Review and I was getting the error “Your post appears to contain code that is not properly formatted as code” even though all my code was in code blocks. By deleting portions of my post to see where the error was arising, I narrowed it down to where I defined the link references, as shown below:

[link1]: http://www.examplesite1.com
[link2]: http://www.examplesite2.com
[link3]: http://www.examplesite3.com
[link4]: http://www.examplesite4.com
[link5]: http://www.examplesite5.com
[link6]: http://www.examplesite6.com

The problem was solved by changing all the link references to follow another naming convention, like this:

[1]: http://www.examplesite1.com
[2]: http://www.examplesite2.com
[3]: http://www.examplesite3.com
[4]: http://www.examplesite4.com
[5]: http://www.examplesite5.com
[6]: http://www.examplesite6.com

Any ideas what's going on here? I am befuddled.

0

2 Answers 2

5

That is a known quirk of that quality check.

I didn't notice it in this form though. I don't know the root-cause but this is a similar example of a false positive:

error not properly formatted code

The pattern I now see emerge is the use of opening and closing brackets outside a code block at the start of a new line.

In the above example I added headings above each image.

In your case you could have done this:

- [link1][1]  
- [link2][2]  
- [link3][3]   
- [link4][4] 

to make them in a proper list. If the quality control check really doesn't give in you can fallback by simply putting the plain html in place.

<a href="http://example.com">Link1</a>

The advice is to not start a line with opening and closing brackets to prevent the error

Your post appears to contain code that is not properly formatted as code.

Either use a list, add a heading between the lines or use plain html markup.

Do notice that [1]: http://link.com is a valid markdown construct. It is used to have a set of links at the bottom of the post and only reference to them with the number. That probably explains why that formatting didn't trigger the error.

1
  • Curiously, none of my links were at the beginning of a line. They were all within paragraphs. The only places where I used brackets at the start of a line was where I defined the link references. Your fix would make a lot more sense, but what I actually did was just change the text used for the link references. I'll edit my question to make it more clear. Commented Feb 8, 2016 at 20:41
3

It appears to be triggered when there are 3+ consecutive lines starting with [, each of which is <=80 characters long.

You can work that around by putting an empty line after every 2 link definitions or by reordering them to put some long link in-between.

P.S.: Both of these link formatting types are considered valid markdown and putting 2 spaces before them doesn't help either. Can it be finally fixed, please?

Edit: From my observations this problem appears to be fixed for about half a year now. If something similar still happens for you, please post it as a separate bug report.

1
  • I was actually facing this problem again in May 2022 with some links, but it no longer happens with those links as of July 2022.
    – EvgenKo423
    Commented Jul 13, 2022 at 12:10

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