Displaying URLs in code on the forum

edited February 2014 in General

Hi everyone,

Today I was helping out an individual having trouble with the JSON class (you can correct me if this is wrong, but this question is not about that.) I made a bit of code demonstrating the loading and displaying of a JSON array of the web, and then published the code. When I look at my reply, instead of the following: http://niwi-bicing.appspot.com/api/all?&format=json, I see this:

http://niwi-bicing.appspot.com/api/all?&format=json

The reason I'm posting is that the code is no longer entirely copy-able (You can't copy it, and then expect it to work). Now, I know why this is happening, but is this wanted?

Answers

  • Ran into this myself today. It is apparently a problem with the forum. See http://forum.processing.org/two/discussion/2991/image-array#Item_4 for a work around.

  • So I saw, earlier, when looking for other posts to answer. I'm sure this'll get fixed sooner or later.

  • Answer ✓

    The technical forum maintainer is aware of the problem but hadn't found the time to fix it. It seems it is because the URL detector (changing plain text URLs to links) kicks in before the syntax highlighter which then uses the code of the transformed URL (to HTML).
    Probably not obvious to solve.

  • I use the following workaround:

    String someUrl = "http" + "://niwi-bicing.appspot.com/api/all?&format=json";
    
  • edited February 2014

    I like to put the "://" in the 1st part instead: :P

    static final String URL = "http://" + "niwi-bicing.appspot.com/api/all?&format=json";
    
Sign In or Register to comment.