Skip to content

Commit 7889a15

Browse files
committed
resolve references to attributes like @mainactor
1 parent 0b2ea11 commit 7889a15

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

Sources/MarkdownPluginSwift/Signature.Expanded (ext).swift

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,18 @@ extension Signature.Expanded
9999

100100
$0[color]
101101
{
102-
if let referent:Scalar = symbols.removeValue(forKey: range.lowerBound)
102+
let offset:Int
103+
if case .attribute = color,
104+
case 0x40 = utf8[range.lowerBound] // '@'
105+
{
106+
offset = range.lowerBound + 1
107+
}
108+
else
109+
{
110+
offset = range.lowerBound
111+
}
112+
113+
if let referent:Scalar = symbols.removeValue(forKey: offset)
103114
{
104115
$0[.href] =
105116
{

0 commit comments

Comments
 (0)