[minor] fixed a bug with headres with inline markup

When using ATX-style headers, you could add inner markup without problems:

input:  # Lorem `ipsum` dolor **sit amet**
output: <h1>Lorem <code>ipsum</code> dolor <strong>sit amet</strong></h1>

However, when using the SetExt-style headers, the output was a mess:

input:  Lorem `ipsum` dolor **sit amet**
        ================================
output: <h1>Lorem XNNN dolor XNNNN</h1>

Now this problem is fixed and you can use inner markup in any heading
without problems, regardless the header style used in the book.