-9

Recently, I tried to answer a question using some basic HTML, which is supposed to be supported with questions/answers. I'm talking very basic stuff, I used

<h2>*Insert header here*</h2> [link name](https//link.com)

and other simple tags so that the answer would look nicer. However, when I tried to post it, I got an error saying that I had incorrectly formatted code. It would not let me post it, until I removed all HTML tags from the answer, and then it posted fine. Then I edited the post, and put all the tags back in the same place, and it worked just fine. I don't think it was a missing tag or anything, because it looked perfectly fine in the answer preview.

Here is my answer with HTML.

I second what user286058 says, but if you are on a different OS, there are other options.

<h2>Mac OS X</h2>
[py2app](https://pypi.python.org/pypi/py2app) or [platypus](http://sveinbjorn.org/platypus).

<h2>Windows</h2>
[py2exe](http://www.py2exe.org).

<h2>Linux</h2>
Probably a little bit more complicated. I have never done this before, but you can get more info 
[here](http://stackoverflow.com/questions/193077/standalone-python-applications-in-linux)

Or, you can just put all external libraries in a folder and zip or rar them. This is probably the easiest solution.

Can we remove this feature? I don't see what the point of it is, as it's extremely annoying when it doesn't work right (Which has happened before. See: Why is my answer triggering a "not properly formatted as code" rejection?) and not very important when it's working right. (IMHO) If someone is trying to post code that is not showing up as code, it shouldn't be too much of a problem.

For example, this is the C++ hello world program without the four space indentation.

include

using namespace std;

int main(void) { cout << "Hello World!\n"; return 0; }


It's fairly obvious that this is supposed to be code, and it shouldn't be too hard to edit into code.

What does the SO meta community think about removing this feature? Maybe even a compromise, and keep the error, but have an option to ignore the error and post anyway?

2
  • "and not very important when it's working right." - It saves someone having to edit it into code, and lets them worry about either helping the person with the question or understanding the answer they're looking at. I find that important.
    – Kendra
    Sep 17, 2014 at 20:33
  • 4
    Do not cry bug if you don't like the intended behavior. Also, we are just about drowning in crap as is, no need to open the flood-gate any further. Sep 17, 2014 at 22:41

2 Answers 2

8

This is here for a reason.

This is to stop, or at least slow down, poorly formatted answers. If your answer has a lot of code that isn't formatted, and you hit the error, then you're less likely to get that non-formatted code block through. If you can't get the html markdown to work, there's markdown built into the editor.

You can even do

Different levels of headers.

In the end, this would cause more harm than good, removing the filter.

Note: Header markdown is just #.

#For Example, a higher header
##And lower.
5
  • 1
    Okay, maybe I'm wrong.
    – DJMcMayhem
    Sep 18, 2014 at 20:19
  • It's cool, we all have those moments. :) I had to look for it myself.
    – Kendra
    Sep 18, 2014 at 20:28
  • You don't even need the trailing hashes (octothorpes?). Only the leading ones are required. Sep 19, 2014 at 2:00
  • @CodyGray I didn't know that. Thanks
    – Kendra
    Sep 19, 2014 at 2:01
  • 5
    thanks for making me google octothropes Sep 19, 2014 at 13:50
5

Block-level HTML elements have a few restrictions:

They must be separated from surrounding text by blank lines. The begin and end tags of the outermost block element must not be indented. Markdown can't be used within HTML blocks.

I think you just needed to add blank lines after your headers.

For example:

Mac OS X

py2app or platypus.

Windows

py2exe.

Linux

Probably a little bit more complicated. I have never done this before, but you can get more info here

You must log in to answer this question.

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