Splunk Search
Highlighted

Why does "Ask a Question" page merge some lines?

Esteemed Legend

I had a perfectly coherent question but when I clicked the "Ask Your Question" button, I saw that the most important text of the body, the stuff that was from inside the *.conf files, had been reformatted and all lines merged! Why did it do that? How can I prevent it? My simple question now looks like barf and I am sure nobody will bother answering it, all because of a lame web-engine setting!

See barf here: http://answers.splunk.com/questions/8740/can-fieldalias-be-used-without-extract-i-e-on-fields-create...

Highlighted

Re: Why does "Ask a Question" page merge some lines?

SplunkTrust
SplunkTrust

The answers site editor lets you tell it things are "code" by indenting them with 4 spaces. Text marked up as code gets formatted with a fixed-width font and with the line breaks you intended.

The easiest way to do this is to paste your stuff in, highlight it, and press the "code" button on the editing button bar. The "code" button is the 5th button from the left and looks like a string of 1's and 0's. Below is an example of how it formats 'code':

[foo]
hi there
blah

It's not uncommon for a moderator to come by and edit your text for formatting if you've pasted in config snippets that have gotten garbled. But, you are absolutely correct that an easy to read question makes folks more likely to answer.

Highlighted

Re: Why does "Ask a Question" page merge some lines?

Builder

I had the same problem. But not knowing about the code button, or four spaces, I use the HTML <pre> tag to format my data such as:

<pre>
Item 1
Item 2
Item 3
</pre>

It works like a charm.

0 Karma
Highlighted

Re: Why does "Ask a Question" page merge some lines?

Splunk Employee
Splunk Employee

hi woodcock,

The simple answer is, MarkDown [the wiki engine on this site] tries to "help" you by collapsing whitespace.

This little script that will help you out, by re-formatting your code snippet for mangle-free posting.


:-)

cheers,

V

View solution in original post

0 Karma