'Readwise: Yellow Highlight Not Displaying Color (Jinja2)

I export my highlights from Kindle to Readwise then from Readwise to Obsidian.

In my kindle app, I use all the highlight colors for different purposes (Pink, Blue, Orange Yellow). Readwise treats "Yellow" as the default so it doesn't create a color tag for this tag and I use Yellow for my more important highlights. What I'm trying to do is create a color tag

Here is my default code before changes:

- {{ highlight_text }}{% if highlight_location and highlight_location_url %} ([{{highlight_location}}]({{highlight_location_url}})){% elif highlight_location %} ({{highlight_location}}){% endif %}{% if highlight_tags %} {% for tag in highlight_tags %}#hl-{{tag}} {% endfor %}{% endif %}{% if highlight_note %}
    - Note: {{ highlight_note }}{% endif %}

So this is where I am stuck.. The code above works, but #hl-yellow will not display.. Any suggestions on how I can get this to work?

Update: So I was able to create a work around so all highlights begin with ##hl and the colors are added with if statements by adding -red -blue -orange instead of it being #hl-red, #hl-blue, and #hl-orange.

So now the output is #hl for yellow, #hl-blue for blue, #hl-orange for orange, and #hl-red for pink.

Is there any way I can subtract a certain amount of characters before I add a color? That way the default tag can be #hl-yellow and I can subtract 6 characters and then just replace the 6 characters from yellow with red blue orange. Is this possible?

Updated Code:

- {{ highlight_text }}{% if highlight_location and highlight_location_url %} ([{{highlight_location}}]({{highlight_location_url}})){% elif highlight_location %} ({{highlight_location}}){% endif %} #hl{% if highlight_tags %}{% for tag in highlight_tags %}{% if tag == "pink" %}-red{% elif tag == "orange" %}-orange{% elif tag == "blue" %}-blue{% else %}-yellow{% endif %} {% endfor %}{% endif %}{% if highlight_note %}
- Note: {{ highlight_note }}{% endif %}


Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source