Our current technique for switching is the following:
Take the wikitext and add one level of indentation:
```
Foo
bar
==baz==
{|
|quux
|}
```
->
```
:Foo
:bar
:==baz==
:{|
:|quux
:|}
```
Convert this to HTML
```lang=html
<dl>
<dd>Foo</dd>
<dd>bar</dd>
<dd>==baz==</dd>
<!-- very broken table: -->
<dd><dl><dd></dd></dl><table><tbody><tr><td>quux<dd>|}</dd></td></tr></tbody></table></dd>
</dl>
```
then unwrap/de-indent the list down to paragraphs:
```lang=html
<p>Foo</p>
<p>bar</p>
<p>==baz==</p>
<!-- broken table -->
```
Pros:
* Correctly converts single linebreaks into separate paragraphs
* Correctly preserves some unsupported syntax, e.g. headings becoming <p>==baz==</p>
Cons:
* Mangles other syntax, resulting in broken roundtrips when you switch back (e.g. tables, templates)
* No warning shown to the user that something bad is about to happen
The alternative approach we have discussed is:
* do a context-less switch of the wikitext as-entered
* before loading VE, check the HTML for unsupported features: tables, headings, templates, images
* if such a feature is found, refuse to switch or show a warning
Cons:
* We still need an approach for converting single linebreaks into separate paragraphs
=== Open questions
- [ ] 1. In what – if any – cases should people be //blocked// from switching from `source` to `visual`?
- [ ] 2. In the cases where people are //blocked// from switching from `source` to `visual`, what should be communicated to them? How should this communication be presented?
- [ ] 3. In what cases should people be //warned// when attempting to switch from `source` to `visual`?
- [ ] 4. In the cases where people are //warned// when attempting to switch from `source` to `visual`, what should be communicated to them? How this communication be presented?
- [ ] 5. How should single linebreaks be convered into separate paragraphs?