fix: work around GitHub formatting issue
authorGreg Hurrell <greg.hurrell@liferay.com>
Tue, 1 Sep 2020 18:10:41 +0000 (20:10 +0200)
committerGreg Hurrell <greg.hurrell@liferay.com>
Tue, 1 Sep 2020 18:14:48 +0000 (20:14 +0200)
commit929ccc20b70a712918a06308a10ac493e65a91f2
treecee3ba6a062c39aaa833b2c87a72332d30bb4c05
parent975dda9972af27f38c7d70b99b73c0ac1813ad4e
fix: work around GitHub formatting issue

When we generate Markdown like this:

    <p align="right"><a name="loupe-smartcase-override" href="#user-content-loupe-smartcase-override"><code>loupe-smartcase-override</code></a></p>
    <strong>`'smartcase'`</strong>

    Turned on (overrides <strong>`'ignorecase'`</strong>, making the search pattern case-sensitive whenever it containers uppercase characters).

GitHub mangles the first `<strong>` element:

    <strong>`'smartcase'`</strong>

But does the right thing with the second one:

    <strong><code>'ignorecase'</code></strong>

If we add another line break in between, the problem goes away.

So, rejig how we emit newlines. Instead of emitting them before
headings, emit them after link targets. This ends up looking better
anyway, resulting in fewer blank lines overall in the output.

Sample change in Loupe project as a result of this change:

https://gist.github.com/wincent/3305bd10ba651320b2c3ea4852d22e91
lib/Text/Docvim/Printer/Markdown.hs