I have spent a lot of extra effort formatting my question to be more readable, by using <pre>
with <b>
inside, rather than plain-texting everything.
When I click the "Post your question" button, I get shown this error:
But the code is all correctly-formatted, and the markdown preview of the entire question looks exactly as I expect it to.
According to Stack Overflow prevents me from posting an answer, claiming markdown text using HTML tags is unformatted code
Stack Overflow uses a system to stop low-effort unformatted posts from being posted.
My post is high-effort and well-formatted.
So I am reporting this bug.
If this is intentional, then obviously the error message should be different.
Your post appears to contain code that is not properly formatted as code
The above is an unclear error message. It should actually say:
Stack Overflow does not support
<pre>
tags in markdown.
So then I can know
- That this is a feature, not a bug
- How to transform my question to make the automated system accept it
Here is the entire markdown source of my question that fails to be posted:
`python manage.py showmigrations` shows
<pre>
<b>mainapp</b>
[X] 0001_initial
...
[X] 0240_employer_data
[X] 0241_person_metadata
[X] 0242_personemployer_employerworkplace
[X] 0243_personemployer_employed_personemployer_stage
[X] 0244_remove_employerworkplace_and_more
</pre>
I ran
```
python manage.py squashmigrations mainapp 0244
```
and now `showmigrations` shows
<pre>
<b>mainapp</b>
[-] 0001_squashed_0244_remove_employerworkplace_and_more (244 squashed migrations) Run 'manage.py migrate' to finish recording.
</pre>
But `python manage.py migrate` reports the errors
```
No migrations to apply.
Your models in app(s): 'mainapp' have changes that are not yet reflected in a migration, and so won't be applied.
Run 'manage.py makemigrations' to make new migrations, and then re-run 'manage.py migrate' to apply them.
```
How can there be changes detected immediately after running squashmigrations without doing anything in between?
`python manage.py makemigrations --dry-run` shows many "Alter field" lines like
<pre>
<b>Migrations for 'mainapp':</b>
<b>mainapp/migrations/0001_squashed_0244_remove_employerworkplace_and_more.py</b>
~ Alter field field on employergroup
~ Alter field image_alt on employee
~ Alter field context on employer
...
</pre>
# My expectation:
After running `squashmigrations`, `makemigrations` should show "No changes detected"
So what happened? What might have caused this bizarre situation? How might I fix it?
I have tried replacing some <pre>
with ```
code fences.
The question can only be posted after every single <pre>
is replaced by a code fence.
<code>
tags inside of the<pre>
<pre>
. But stackoverflow shouldn't show me a working preview if they don't support it IMO. I've seen many questions on the site using<pre>
and they all work.pre
. Yes,pre
is supported HTML syntax, but because you use so much of it, the parser thinks you're posting unformatted code, aspre
isn't the preferred method of posting code blocks. (I wouldn't be surprised if that system countspre
blocks as "unformatted HTML")bug
too.<pre>
, I get this error (just tried, by editing my question and replacing a single code fence with a<pre>
)pre
at all. Use code fences for your code. Don't use code-like formatting for text that isn't code.