Skip to content
This repository has been archived by the owner on Nov 10, 2022. It is now read-only.

Commit

Permalink
Fix: don't render links when plugin replaces core rule
Browse files Browse the repository at this point in the history
  • Loading branch information
kaicataldo committed May 8, 2020
1 parent 384d874 commit 52021ef
Showing 1 changed file with 16 additions and 11 deletions.
27 changes: 16 additions & 11 deletions docs/rules/index.liquid
Expand Up @@ -50,17 +50,22 @@ layout: doc
<td markdown="1">
<a href="{{ rule.name }}">{{ rule.name }}</a>
</td>
{% if rule.replacedBy.size > 0 %}
<td class="replaced-by" markdown="1">
{% for replaced in rule.replacedBy %}
<a href="{{ replaced }}">{{ replaced }}</a>
{% endfor %}
</td>
{% else %}
<td class="replaced-by" markdown="1">
<p class="text-muted">(no replacement)</p>
</td>
{% endif %}
<td class="replaced-by" markdown="1">
{% assign hasReplacement = false %}
{% if rule.replacedBy.size > 0 %}
{% for replaced in rule.replacedBy %}
{% comment %} Do not link to comments in 3rd party plugins. {% endcomment %}
{% assign ruleNameSegments = replaced | split: "/" %}
{% if ruleNameSegments.size == 1 %}
<a href="{{ replaced }}">{{ replaced }}</a>
{% assign hasReplacement = true %}
{% endif %}
{% endfor %}
{% endif %}
{% if hasReplacement == false %}
<p class="text-muted">(no replacement)</p>
{% endif %}
</td>
</tr>
{% endfor %}
</tbody>
Expand Down

0 comments on commit 52021ef

Please sign in to comment.