wymeditor/wymeditor — pull request #421 by FriedRice (2013-07-30 17:16:18+00:00)
Title: Fix outdenting in structured headings plugin so that it will not let you create an invalid heading structure

In the structured headings plugin currently, it will let you outdent a heading to more than one level above the level of its following heading in some cases. This allows a user to create an invalid heading structure where a heading is followed by heading more than one level below it.

For example, if the following heading structure is in the editor:
```html

1

1_1

1_1_1

1_1_2

1_1_3

```
the plugin will allow the user to outdent the `outdent_me` heading twice so that it become an `h1` heading as in the following code:
```html

1

1_1

1_1_1

1_1_2

1_1_3

```
This creates an invalid heading structure because it has an `h1` heading directly followed by an `h3` heading.

This issue can be fixed pretty easily by just checking the level of the heading directly following a heading before outdenting to make sure an invalid heading structure is not created.