From 59d3be4d1cce7093e671274683b750a9c41b470b Mon Sep 17 00:00:00 2001
From: Rhys Arkins <rhys@keylocation.sg>
Date: Tue, 14 Nov 2017 20:44:32 +0100
Subject: [PATCH] fix: replace h4 with ** (gitlab) (#1167)

Helps #954
---
 lib/workers/pr/index.js                          | 3 ++-
 test/workers/pr/__snapshots__/index.spec.js.snap | 2 +-
 2 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/lib/workers/pr/index.js b/lib/workers/pr/index.js
index a29adc7a06..82a690211d 100644
--- a/lib/workers/pr/index.js
+++ b/lib/workers/pr/index.js
@@ -140,8 +140,9 @@ async function ensurePr(prConfig) {
   if (config.isGitLab) {
     // Convert to HTML using GitHub-flavoured markdown as it is more feature-rich than GitLab's flavour
     prBody = converter
+
       .makeHtml(prBody)
-      .replace('</h4>', ' </h4>') // See #954
+      .replace(/<\/?h4[^>]*>/g, '**') // See #954
       .replace(/Pull Request/g, 'Merge Request')
       .replace(/PR/g, 'MR');
   } else if (config.isVsts) {
diff --git a/test/workers/pr/__snapshots__/index.spec.js.snap b/test/workers/pr/__snapshots__/index.spec.js.snap
index ff05c02f7c..b107e7e3e7 100644
--- a/test/workers/pr/__snapshots__/index.spec.js.snap
+++ b/test/workers/pr/__snapshots__/index.spec.js.snap
@@ -34,7 +34,7 @@ Array [
 <h3 id=\\"commits\\">Commits</h3>
 <p><details><br />
 <summary>renovateapp/dummy</summary></p>
-<h4 id=\\"110\\">1.1.0 </h4>
+**1.1.0**
 <ul>
 <li><a href=\\"https://github.com/renovateapp/dummy/commit/abcdefghijklmnopqrstuvwxyz\\"><code>abcdefg</code></a> foo <a href=\\"https://github.com/renovateapp/dummy/issues/3\\">#3</a></li>
 </ul>
-- 
GitLab