I see that, you're respecting selections if any. However selecting some text and running the command throws me this error in the latest Sublime beta:

````
Traceback (most recent call last):
  File "C:\Program Files\portable_SublimeText\sublime_plugin.py", line 549, in run_
    return self.run(edit)
  File "C:\Program Files\portable_SublimeText\Data\Packages\MarkdownEditing\underlined_headers.py", line 122, in run
    regions.reverse()
AttributeError: 'Selection' object has no attribute 'reverse'
````

IMHO, there is no need to respect selections. Users usually will run this command on the whole file. OTOH there are too much arithmetic below (especially in this line: `mreg = sublime.Region(region.begin()+m.start(), region.begin()+m.end())`) and that might mess with unicode text. I'm no python expert, just my opinions.