I've seen that other people (e.g. @Charles Miller [Atlassian] in this example) have managed to paste more than 1 line of code into this UI without it splitting the code block into multiple code blocks.
When I do it, each line has it's own one-line code block e.g.
// comment on line 1
// comment on line 2
Or this example.
What's the secret? Please share.
I'd say it depends on where you're copying from. Below is copied from a raw output from github. Spacing is screwed (so had to be corrected a bit) but it pasted in one block
When you hit ENTER, by default this starts a new paragraph which will make a new code block. Shift-ENTER keeps the same block
String authUrl = null; try { link.createAuthenticatedRequestFactory().createRequest(MethodType.GET, ""); } catch(CredentialsRequiredException e) { // if an exception is thrown, we need to prompt for oauth authUrl = e.getAuthorisationURI().toString(); }
But why does the formatting suck so hard when compared to stackoverflow or even atlassian's many "code" macros. How about a horizontal scrollbar to stop it wrapping? Not to mention syntax highlighting. Oh and a "preview" function would be great too.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
A few days ago we released some improvements to the editor. There's a 'code' button that'll allow syntax highlighiting, a [show preview], and horizontal scrolling.
I hope it's better. There are still more improvements to come.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
OK, it looks like someone fixed the linked example above :)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.