# Security Hotspot UI does not display rule descriptions properly

**URL:** <https://community.sonarsource.com/t/security-hotspot-ui-does-not-display-rule-descriptions-properly/21431>\
**Category:** SonarQube Server / Community Build\
**Tags:** sonarqube\
**Created:** [March 11, 2020, 5:30am UTC](https://community.sonarsource.com/t/security-hotspot-ui-does-not-display-rule-descriptions-properly/21431 "2020-03-11T05:30:28Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jonah\_IntegraDev](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/jonah_integradev/32/51492_2.png) [@Jonah\_IntegraDev](https://community.sonarsource.com/u/Jonah_IntegraDev)\
**Post date:** [March 11, 2020, 5:30am UTC](https://community.sonarsource.com/t/security-hotspot-ui-does-not-display-rule-descriptions-properly/21431/1 "2020-03-11T05:30:28Z")

</div>

- version: SonarQube 8.2
- error observed: It looks like the new Security Hotspots UI can only handle HTML descriptions. This doesn’t play well with template rules, which vomit a garbled mess of markdown into the “What’s the risk?” tab.
- steps to reproduce: Create a security hotspot rule from a template and view one in the new Security Hotspots UI

Example:

 ![image](https://europe1.discourse-cdn.com/sonarsource/uploads/sonarcommunity/original/2X/c/cdf339506db73c9bb6f59674e1e4998cdbeda742.png)

---

<div class="post-metadata">

**Author:** ![Alexandre\_Gigleux](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/alexandre_gigleux/32/26_2.png) [@Alexandre\_Gigleux](https://community.sonarsource.com/u/Alexandre_Gigleux)\
**Post date:** [March 11, 2020, 8:00pm UTC](https://community.sonarsource.com/t/security-hotspot-ui-does-not-display-rule-descriptions-properly/21431/3 "2020-03-11T20:00:51Z")

</div>

Hello,

Actually the bug is more on the fact that you managed to create a Security Hotspot from a Template Rule which is not a use case we identified.

How did you manage to create this Security Hotspot? From which Template Rule?

Thanks  
Alex

---

<div class="post-metadata">

**Author:** ![Jonah\_IntegraDev](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/jonah_integradev/32/51492_2.png) [@Jonah\_IntegraDev](https://community.sonarsource.com/u/Jonah_IntegraDev)\
**Post date:** [March 11, 2020, 10:51pm UTC](https://community.sonarsource.com/t/security-hotspot-ui-does-not-display-rule-descriptions-properly/21431/5 "2020-03-11T22:51:53Z")

</div>

Hi Alex,

_Actually_, the bug is the fact that SonarQube is arbitrarily ripping apart the HTML descriptions of security hotspot rules according to your own header conventions in order to construct these tabs on the new UI interface.

This is a custom plugin, and the Security Hotspot rule in question is derived from a “track use of method” template rule. This is an important use case for us, and it will be problematic if it’s removed.  
With this rule for example, we have our own regex framework in this codebase. If we can’t define the regex methods to track in some template rule then we’d have to hardcode method signatures from our own personal framework into the plugin, which is simply not the right place for that data to live.

In answer to your question of how I created this, you have always been able to create Security Hotspot rules from templates. An option for which type of rule it should be is provided when you create it. (See below)

 ![image](https://europe1.discourse-cdn.com/sonarsource/uploads/sonarcommunity/original/2X/5/529d0e0a11af685970fbf4f038717fd0f08e11bc.png)

---

<div class="post-metadata">

**Author:** ![Alexandre\_Gigleux](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/alexandre_gigleux/32/26_2.png) [@Alexandre\_Gigleux](https://community.sonarsource.com/u/Alexandre_Gigleux)\
**Post date:** [March 13, 2020, 3:57pm UTC](https://community.sonarsource.com/t/security-hotspot-ui-does-not-display-rule-descriptions-properly/21431/6 "2020-03-13T15:57:05Z")

</div>

Thanks @Jonah_IntegraDev for the detailed explanations.

To be completely honest, we missed this use case when we worked on the new Security Hotspots page, hence why you have this weird display. Still it makes sense and the markdowns should not be ignored like it is today, so here is the ticket to fix that problem: [https://jira.sonarsource.com/browse/SONAR-13199](https://jira.sonarsource.com/browse/SONAR-13199)

Thanks  
Alex

---

<div class="post-metadata">

**Author:** ![Jonah\_IntegraDev](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/jonah_integradev/32/51492_2.png) [@Jonah\_IntegraDev](https://community.sonarsource.com/u/Jonah_IntegraDev)\
**Post date:** [May 4, 2020, 6:04am UTC](https://community.sonarsource.com/t/security-hotspot-ui-does-not-display-rule-descriptions-properly/21431/8 "2020-05-04T06:04:49Z")

</div>

Hi @Alexandre_Gigleux,

I was happy to see that markdown is now being converted to HTML in Sonar 8.3.  
There is a slight issue with the current implementation though.

Even when using the markdown-equivalent of h2, markdown descriptions won’t be split into the ‘What’s the risk?’, ‘Are you at risk’, and ‘How can you fix it?’ tabs. This is because, when the line “== Ask Yourself Whether\n” is converted to HTML, it’s converted as “\<h2\>Ask Yourself Whether\n\</h2\>” with the newline inside of the tags instead of outside.

The trailing newline causes a problem with recognizing these headers as sections in the description, and so the entire description is displayed under the single ‘What’s the risk?’ tab.

Cheers,  
Jonah

---

<div class="post-metadata">

**Author:** ![Jeremy\_Davis](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/jeremy_davis/32/2852_2.png) [@Jeremy\_Davis](https://community.sonarsource.com/u/Jeremy_Davis)\
**Post date:** [May 4, 2020, 7:42am UTC](https://community.sonarsource.com/t/security-hotspot-ui-does-not-display-rule-descriptions-properly/21431/9 "2020-05-04T07:42:15Z")

</div>

Hi @Jonah_IntegraDev,

I’ve created [a ticket to fix that](https://jira.sonarsource.com/browse/SONAR-13357).

Thanks for the feedback!  
Jay
