-3

This question already has an answer here:

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

marked as duplicate by Praveen Kumar Purushothaman, Community May 26 '16 at 15:51

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

  • 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 Jan 5 '16 at 16:05
  • @KevinB Woah.... This happened not just for me. I keep seeing it more often in the past one hour. – Praveen Kumar Purushothaman Jan 5 '16 at 16:08
  • Can you provide steps to recreate the issue? seems to work just fine for me. – Kevin B Jan 5 '16 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. – Praveen Kumar Purushothaman Jan 5 '16 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 Jan 5 '16 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. – Praveen Kumar Purushothaman Jan 5 '16 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 Jan 5 '16 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. – Praveen Kumar Purushothaman Jan 5 '16 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. – Shadow The Curly Braced Wizard Jan 5 '16 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. – Praveen Kumar Purushothaman Jan 5 '16 at 16:25
  • Post links and we'll see. – Shadow The Curly Braced Wizard Jan 5 '16 at 16:27
  • Sure... Posting it. – Praveen Kumar Purushothaman Jan 5 '16 at 16:27
  • In that example, <!-- begin snippet: js hide: false --> is indented, thus making it part of the css code block. – Kevin B Jan 5 '16 at 16:29
  • 1
    No matter what i do i can't get it to insert that js snippet start comment. – Kevin B Jan 5 '16 at 16:35
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.

  • Oh yeah.. How did you even do this? I didn't do the indenting the begin snippet comment and removing the end snippet comment. – Praveen Kumar Purushothaman Jan 5 '16 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 Jan 5 '16 at 16:27
  • I didn't do the indenting the begin snippet comment and removing the end snippet comment. – Praveen Kumar Purushothaman Jan 5 '16 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 Jan 5 '16 at 16:28

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