THIS ... IS ... FORTRESS! Fortress was a language being developed by the Sun Programming Language Research Group (R.I.P. Fortress) that had a unique property to it, it was possible to render ("Fortify") programs in different font-styles (i.e. blackboard bold, bold, italics, roman, etc. ). The goal is to represent a one-char Fortress variable in HTML markup.

Here's how the fortification of one-char variables worked (simplified/modified from documentation for code-golfing purposes):


If the variable is a repeated capital (i.e. ZZ), it becomes formatted in blackboard bold (ℂℍℕℙℚℝℤ)
If the variable is preceded by an underscore, the variable is rendered in roman font (left alone)
If the variable is followed by an underscore, the variable is rendered in bold font (&lt;b&gt;v&lt;/b&gt;)
If the variable is neither preceded nor followed by an underscore, the variable is rendered in italic font (&lt;i&gt;v&lt;/i&gt;)
The codepoints of the blackboard bolds are: :1D538, :1D539,  ℂ:2102, :1D53B, :1D53C, :1D53D, :1D53E, ℍ:210D, :1D540, :1D541, :1D542, :1D543, :1D544, ℕ:2115, :1D546, ℙ:2119, ℚ:211A, ℝ:211D, :1D54A, :1D54B, :1D54C, :1D54D, :1D54E, :1D54F, :1D550, ℤ:2124. These count as one byte each in your program (if your language of choice can handle these characters at all)


Input will be either a repeated ASCII capital, or a single ASCII letter with either no underscore, a leading underscore, or a trailing underscore (AKA _a_ will not be an input). This is code-golf so lowest byte count wins! 

Test cases:

a =&gt; &lt;i&gt;a&lt;/i&gt;
BB =&gt; 
c_ =&gt; &lt;b&gt;c&lt;/b&gt;
_d =&gt; d
E =&gt; &lt;i&gt;E&lt;/i&gt;
G_ =&gt; &lt;b&gt;G&lt;/b&gt;
_H =&gt; H
ZZ =&gt; ℤ


Links: Specification, Direct download of version 0.1 alpha.

Reference implementation (This would be in Fortress, but Fortress doesn't like most of the doublestruck characters, so this implementation is in D):

dstring fortify(string arg) {
    import std.string, std.conv;

    alias D = to!dstring; //Convert to a string that accepts the unicode needed
    dstring BB = "ℂℍℕℙℚℝℤ"d; //blackboard bold capitals
    string UC = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"; //normal ASCII capitals

    if(arg.length == 1)
        return D("&lt;i&gt;" ~ arg ~ "&lt;/i&gt;");
    if(arg[0] == a[1])
        return D(BB[UC.indexOf(arg[0])]);
    if(arg[0] == '_')
        return D(arg[1]);
    return D("&lt;b&gt;" ~ arg[0] ~ "&lt;/b&gt;");
}
Python 3.6, 159 131 128 bytes

1 byte saved thanks to @Zacharý

3 bytes saved thanks to @VаlueInk

28 bytes saved thanks to @Rod



lambda s:len(s)&lt;2and f"&lt;i&gt;{s}&lt;/i&gt;"or s[0]==s[1]and"ℂℍℕℙℚℝℤ"[ord(s[0])-65]or[f"&lt;b&gt;{s[0]}&lt;/b&gt;",s[1]][s[0]=='_']


Try it online!