diff --git a/Sources/SwiftDocC/Model/DocumentationNode.swift b/Sources/SwiftDocC/Model/DocumentationNode.swift index 1976c8b2d..5d865b9f9 100644 --- a/Sources/SwiftDocC/Model/DocumentationNode.swift +++ b/Sources/SwiftDocC/Model/DocumentationNode.swift @@ -848,6 +848,7 @@ public struct DocumentationNode { } private let directivesSupportedInDocumentationComments = [ + Comment.directiveName, Metadata.directiveName, DeprecationSummary.directiveName, ] diff --git a/Tests/SwiftDocCTests/Semantics/SymbolTests.swift b/Tests/SwiftDocCTests/Semantics/SymbolTests.swift index a06c77ce9..09d3d9c2a 100644 --- a/Tests/SwiftDocCTests/Semantics/SymbolTests.swift +++ b/Tests/SwiftDocCTests/Semantics/SymbolTests.swift @@ -1338,6 +1338,19 @@ class SymbolTests: XCTestCase { "This is the deprecation summary." ) } + + func testAllowsCommentDirectiveInDocComment() throws { + let (_, problems) = try makeDocumentationNodeForSymbol( + docComment: """ + The symbol's abstract. + + @Comment(This is a comment) + """, + articleContent: nil + ) + + XCTAssert(problems.isEmpty) + } // MARK: - Helpers