4

I noticed in last 2 weeks that when I post/edit a C++ code in my answers

  • then sometimes bracket for array access get changed indexes/address
  • I thought it was my typo but in source code where the code is copied was always all fine
  • finally today I noticed that after one edit (of many) of this Answer
  • all brackets for array access like

    ix0[i][0]=x;
    ix0[i][1]=y;
    ix0[i][2]=z;
    
  • get changed to

    ix0[i][0]=x;
    ix0[i][37]=y;
    ix0[i][38]=z;
    
  • the index gets unique and only index 0 remain unchanged

  • for any bracket the site scripts add new external link entry
  • (by duplicating the first one ...an image in this case)
  • you can see the edit history of that linked question to see what exactly happened
  • revision 9 messes all up (inserted new version of code)
  • an warning message pops up at that time that mine text cross 30000Byte barrier
  • so I delete the original source code before submitting changes
  • but this bug occur even without any error messages before on different answers
  • so it could be unrelated
  • Also it could be related to insertion of both code an image at the same edit
  • I use both heavily

So is there a way to avoid this?

Or am I doing something wrong?

  • as mentioned I become aware of this just in last 2 weeks
  • and using this site with unchanged manner ...
  • so it could be something newly added perhaps ...

2 Answers 2

6

The problem stems from [text][#] getting interpreted as a link when there are links of style [#]: http://example.com at the end of the document.

The easy approach this is "dont' use that style of markdown". There is an alternate link style: [text](http://example.com). By not having any 'end note' link styles, then the text of [1][2] remains exactly that rather than the endnote style.

When a link is added with the endnote style links, the editor attempts to renumber everything - and that is where the error is occurring. It doesn't understand the difference between links in the text and things that look like links, but are actually code.

Just use inline links.

1
  • @Spektre images can also cause problems (as they have similarities to the link) and you might want to consider using classic html tags: <img src="..." /> which are whitelisted - if that becomes a problem source too.
    – user289086
    Apr 14, 2015 at 14:47
8

This won't happen anymore, I finally fixed this problem yesterday (it wasn't new, the issue has existed forever). See my answer on Meta.SE for some details.

You must log in to answer this question.

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