aboutsummaryrefslogtreecommitdiffstats
path: root/sonar-markdown
diff options
context:
space:
mode:
authorPhilippe Perrin <philippe.perrin@sonarsource.com>2021-02-23 17:22:27 +0100
committersonartech <sonartech@sonarsource.com>2021-02-25 20:07:33 +0000
commitffaa8f3cd63239fc25c624955e8e0760dc53ce11 (patch)
tree652ce34e5bc60d0ad5f780c07d49502ca54e0cd9 /sonar-markdown
parentfcb392a997597f6c60b2851df19cd6a5e09de65d (diff)
downloadsonarqube-ffaa8f3cd63239fc25c624955e8e0760dc53ce11.tar.gz
sonarqube-ffaa8f3cd63239fc25c624955e8e0760dc53ce11.zip
SONAR-13357 Custom hotspot rule's description isn't split into tabs
Diffstat (limited to 'sonar-markdown')
-rw-r--r--sonar-markdown/src/main/java/org/sonar/markdown/HtmlHeadingChannel.java2
-rw-r--r--sonar-markdown/src/test/java/org/sonar/markdown/MarkdownTest.java4
2 files changed, 3 insertions, 3 deletions
diff --git a/sonar-markdown/src/main/java/org/sonar/markdown/HtmlHeadingChannel.java b/sonar-markdown/src/main/java/org/sonar/markdown/HtmlHeadingChannel.java
index 808e79e0300..fbd1dd71021 100644
--- a/sonar-markdown/src/main/java/org/sonar/markdown/HtmlHeadingChannel.java
+++ b/sonar-markdown/src/main/java/org/sonar/markdown/HtmlHeadingChannel.java
@@ -71,7 +71,7 @@ public class HtmlHeadingChannel extends RegexChannel<MarkdownOutput> {
CharSequence headingText = token.subSequence(index, token.length());
output.append("<h" + headingLevel + ">");
- output.append(headingText);
+ output.append(headingText.toString().trim());
output.append("</h" + headingLevel + ">");
}
}
diff --git a/sonar-markdown/src/test/java/org/sonar/markdown/MarkdownTest.java b/sonar-markdown/src/test/java/org/sonar/markdown/MarkdownTest.java
index 865c2281aeb..553aae54adf 100644
--- a/sonar-markdown/src/test/java/org/sonar/markdown/MarkdownTest.java
+++ b/sonar-markdown/src/test/java/org/sonar/markdown/MarkdownTest.java
@@ -61,8 +61,8 @@ public class MarkdownTest {
@Test
public void shouldDecorateHeadings() {
- assertThat(Markdown.convertToHtml(" = Top\r== Sub\r\n=== Subsub\n ==== \n 1.five"))
- .isEqualTo("<h1>Top\r</h1><h2>Sub\r\n</h2><h3>Subsub\n</h3><h4></h4> 1.five");
+ assertThat(Markdown.convertToHtml(" = Top\r== Sub\r\n=== Sub sub\n ==== \n 1.five"))
+ .isEqualTo("<h1>Top</h1><h2>Sub</h2><h3>Sub sub</h3><h4></h4> 1.five");
}
@Test