I've into a problem where the \a macro followed by an href was causing variables to be inappropriately moved around/replaced. The text ref which started the href link was replaced with just the [src] giving the name. And another variable entirely within the href text was replaced with the \ref[src] text ref.
It's possible other text macros also have collisions with hrefs, but I couldn't tell you as I only tested this specific instance.
Numbered Steps to Reproduce Problem:
1. Have the \a text ref macro before an href
2. Have the src=\ref[src]
3. Have some other variable following within the text of the href
Code Snippet (if applicable) to Reproduce Problem:
Essentially this code
to_chat(U, "<span class='name'>[U]</span> holds \a <a href='byond://?src=\ref[src];showpicture=\ref[W]'>[thename] up</a> to one of your cameras ...")
Was being compiled as this code
to_chat(U, "<span class='name'>[U]</span> holds \a <a href='byond://?src=[src];showpicture=\ref[W]'>\ref[src] up</a> to one of your cameras ...")
The \a macro caused the text ref macro on the src to be replaced with just src (making the href link just show the name of the object), and caused the variable within the href text [thename] to be entirely replaced by \ref[src]
Expected Results:
I expected to get this in my chat
Admin holds a Monitor Decryption Key up to one of your cameras ...
(href link when hovered over)
byond://?src=[0x6008bcb];showpicture=[0x2004f63]
Actual Results:
I received something like this instead
Admin holds a [0x6008bcb] up to one of your cameras ...
(href link when hovered over)
byond://?src=security camera;showpicture=[0x2004f63]
When does the problem NOT occur?
It doesn't occur when I place another variable between the \a and the href link.
Workarounds:
Put other variables before the href link and after the \a, I suppose. Perhaps even an empty [] would suffice, though it would certainly look odd, not to mention it would invalidate the point of using \a in the first place.