[FEATURE]: Convert Arrowhead text formatting tags to standard HTML tags.
What problem does it solve
Arrowhead uses seemingly arbitrary text formatting system that isn't compatible with most (if any) applications.
What is the solution
Convert Arrowhead's formatting tags from their endpoint to standard HTML tags.
Existing alternatives
Manually converting tags in each application.
Added value
Would simplify text formatting for applications using the API, rather than having to convert the tags each time.
Additional notes
Although I'm unsure how exactly they use their tags, for the dispatches the headline is tagged with <i=3></i> which seems to be either a bold or header tag, while <i=1></i> makes text bold and yellow colored. Not sure the best way to interpret and convert them.
I have yet to see what <i=2></i> does if it exists.
Not sure the best way to interpret and convert them
Agreed. That's why I think we should not convert them to other tags. I would argue for either stripping them or keeping them.
If it is decided to keep them, clients can decide for themselves how to deal with the tags, depending on their usecase.
This is simple string processing and has nothing to do with the API directly, so in my eyes, your suggestion should not be scope of this repository, but rather of clients using it.
I wouldn't necessarily strip them as we'd 'lose' data that way. However, I don't think that transforming them into HTML would be out of scope for V1, if people want to fetch the original message they can always look to the raw endpoints.
As a compromise, instead of compiling it to <b> tags etc we could have a conversion like this:
<i=3> => <span class="3">
this way the clients can choose how they handle styling (if at all)
Ladies and gentlemen. I present to you: HDML - Helldivers Markup Language. Gonna compile everything I know about HDML here:
These are the tags that have previously been used by AHG thus far:
<i=1>lorem ipsum</i> - yellow text
<i=3>lorem ipsum</i> - bold text
Besides that, I've come across a few other tags that we are yet to see while looking through the subtitle dump posted by Chats
I've found this line which makes me suspect that <i=2></i> sets the text's color to the automaton's red color.
Select a Sector to do <i=1>Missions</i> in, either against the <i=2>Automaton legion</i> or the <i=3>Terminid swarm</i>
I've also found a tag with this syntax: <f=X>lorem ipsum</f>. Though I am yet to figure out what it actually does.
And lastly, theres the <c=#DEADBEEF>my awesome text</i> tag, which I highly suspect of being used to apply RGBA color to text.
When I added support for HDML in Helldivers Companion, I just replaced <i=1> with <span class="text-yellow">, <i=3> with <span class="font-bold"> and </i> with </span>.
Hope this helps :)
Actually, looking back, i don't think <i=2></i> is red. In the screenshot I attached earlier, <i=3> is used for the Terminids, so it would be very odd for the Automatons to be red and for the Terminids to just be, well, bold.
My solution - either somehow tamper with the API responses returned by the API to include these tags that we're missing, or just play the waiting game.