-3

I found a bug today in Stack Exchange's Code Snippet. Kindly check this. While inserting code snippet, this happens:

Please try to solve this.

Note: I am not exactly sure how to recreate. It just happened. I happened to see few just recently. I will surely explain, if I get a chance to replicate.

Reference Post: https://stackoverflow.com/a/34615823/462627

21
  • Looks like you may have tried to insert a code snippet into an existing code block (which of course won't work properly.) Fixing it should be relatively easy, just un-indent the code snippet back to the root.
    – Kevin B
    Commented Jan 5, 2016 at 16:05
  • @KevinB Woah.... This happened not just for me. I keep seeing it more often in the past one hour. Commented Jan 5, 2016 at 16:08
  • Can you provide steps to recreate the issue? seems to work just fine for me.
    – Kevin B
    Commented Jan 5, 2016 at 16:17
  • @KevinB I am not exactly sure how to recreate. It just happened. I happened to see few just recently. I will surely explain, if I get a chance to replicate. Commented Jan 5, 2016 at 16:18
  • Then it likely isn't a bug, and is instead someone messing with the snippet after posting it in such a way that breaks it.
    – Kevin B
    Commented Jan 5, 2016 at 16:18
  • @KevinB This happened in my answer too. I just removed that line. If I am inserting a snippet inside another snippet, then how it shows only for the JS? And not for HTML and CSS? Weird. Commented Jan 5, 2016 at 16:19
  • @PraveenKumar What exactly is happening this comment just made it more confusing, what does it add and what doesn't it add? And are you trying to create a snippet in a snippet?
    – Thaillie
    Commented Jan 5, 2016 at 16:24
  • @Thaillie No. I am not sure. I am definitely not trying to create a snippet in snippet. But what happened was, when I kinda feel this happened during the edit snippet phase. Commented Jan 5, 2016 at 16:25
  • I tend to agree with @Kevin - the snippets are quite delicate, so likely a misplaced edit broke them. Just be careful when editing the raw code. Commented Jan 5, 2016 at 16:25
  • It is not just with me. There are two other posts had this. Then now I feel I am not doing any mistake. Commented Jan 5, 2016 at 16:25
  • Post links and we'll see. Commented Jan 5, 2016 at 16:27
  • Sure... Posting it. Commented Jan 5, 2016 at 16:27
  • @ShadowWizard stackoverflow.com/a/34615823/462627 Commented Jan 5, 2016 at 16:29
  • In that example, <!-- begin snippet: js hide: false --> is indented, thus making it part of the css code block.
    – Kevin B
    Commented Jan 5, 2016 at 16:29
  • 1
    No matter what i do i can't get it to insert that js snippet start comment.
    – Kevin B
    Commented Jan 5, 2016 at 16:35

1 Answer 1

3
test code block

test code snippet

seems to work fine for me. However, I can forcibly recreate the issue by indenting the begin snippet comment and removing the end snippet comment.

test code block


<!-- begin snippet: js hide: false -->
test code snippet

I wouldn't call this a bug, just incorrect usage of the code snippet tool. There's really nothing to fix.

4
  • Oh yeah.. How did you even do this? I didn't do the indenting the begin snippet comment and removing the end snippet comment. Commented Jan 5, 2016 at 16:26
  • I indented the begin snippet comment so it would be considered as part of the first code block, then removed the end snippet comment so that the snippet code wouldn't recognize it as a code snippet.
    – Kevin B
    Commented Jan 5, 2016 at 16:27
  • I didn't do the indenting the begin snippet comment and removing the end snippet comment. Commented Jan 5, 2016 at 16:27
  • the snippet tool doesn't do that either. The code block tool would do the indentation, but it wouldn't remove the end snippet comment.
    – Kevin B
    Commented Jan 5, 2016 at 16:28

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