-
Notifications
You must be signed in to change notification settings - Fork 244
Open
Description
The at-directive parser looks for runs of ~ or ` to delimit the start and end of code blocks. It knows that an at-directive can't start by @foo inside a code block. However, if one of those lines appears in an HTML comment, the at-directive parser doesn't ignore the line. This results in the "not in a code block" logic being inverted. For example, we ran into this issue in "The Swift Programming Language" (reduced example):
<!--
Adding Child Tasks to a Task Group
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- Creating a group with ``withTaskGroup`` and ``withThrowingTaskGroup``
- awaiting ``withGroup`` means waiting for all child tasks to complete
-->
```
struct NonsendableTemperatureReading {
var measurement: Int
}
@available(*, unavailable)
extension NonsendableTemperatureReading: Sendable { }
```
In this case, @available is treated as the start of an at-directive and the code listing is mis-parsed and displays as follows:
rdar://101828693
Metadata
Metadata
Assignees
Labels
No labels
