You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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
The text was updated successfully, but these errors were encountered:
amartini51
added a commit
to amartini51/swift-book
that referenced
this issue
Nov 11, 2022
The tildes look like the start of a fenced code block, inverting the
logic in DocC that knows at-directive blocks can't start in a code
listing, which in turn causes the @available in the non-sendable example
to be misparsed as the start of a directive.
Works around swiftlang/swift-markdown#88
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):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
The text was updated successfully, but these errors were encountered: