diff --git a/Package.resolved b/Package.resolved index 3e7b804f6e..9e5da617d2 100644 --- a/Package.resolved +++ b/Package.resolved @@ -87,7 +87,7 @@ "location" : "https://github.com/swiftlang/swift-markdown.git", "state" : { "branch" : "main", - "revision" : "d21714073e0d16ba78eebdf36724863afc36871d" + "revision" : "5ad49ed3219261b085e86da832d0657752bba63c" } }, { diff --git a/Sources/SwiftDocC/Model/Rendering/RenderContentCompiler.swift b/Sources/SwiftDocC/Model/Rendering/RenderContentCompiler.swift index a8c03b5c26..58fabccede 100644 --- a/Sources/SwiftDocC/Model/Rendering/RenderContentCompiler.swift +++ b/Sources/SwiftDocC/Model/Rendering/RenderContentCompiler.swift @@ -359,6 +359,10 @@ struct RenderContentCompiler: MarkupVisitor { return renderableDirective.render(blockDirective, with: &self) } + mutating func visitDoxygenAbstract(_ doxygenAbstract: DoxygenAbstract) -> [any RenderContent] { + doxygenAbstract.children.flatMap { self.visit($0)} + } + mutating func visitDoxygenDiscussion(_ doxygenDiscussion: DoxygenDiscussion) -> [any RenderContent] { doxygenDiscussion.children.flatMap { self.visit($0) } } diff --git a/Tests/SwiftDocCTests/Semantics/DoxygenTests.swift b/Tests/SwiftDocCTests/Semantics/DoxygenTests.swift index 664ce47513..99b7d85950 100644 --- a/Tests/SwiftDocCTests/Semantics/DoxygenTests.swift +++ b/Tests/SwiftDocCTests/Semantics/DoxygenTests.swift @@ -19,6 +19,7 @@ class DoxygenTests: XCTestCase { func testDoxygenDiscussionAndNote() throws { let documentationLines: [SymbolGraph.LineList.Line] = """ This is an abstract. + @abstract This is description with abstract. @discussion This is a discussion linking to ``AnotherClass`` and ``AnotherClass/prop``. @@ -96,6 +97,7 @@ class DoxygenTests: XCTestCase { XCTAssertEqual(symbol.abstract?.format(), "This is an abstract.") XCTAssertEqual(symbol.discussion?.content.map { $0.format() }, [ + #"\abstract This is description with abstract."#, #"\discussion This is a discussion linking to ``doc://unit-test/documentation/ModuleName/AnotherClass`` and ``doc://unit-test/documentation/ModuleName/AnotherClass/prop``."#, #"\note This is a note linking to ``doc://unit-test/documentation/ModuleName/Class3`` and ``Class3/prop2``."# ]) @@ -108,10 +110,10 @@ class DoxygenTests: XCTestCase { XCTAssertEqual(renderNode.primaryContentSections.count, 1) let overviewSection = try XCTUnwrap(renderNode.primaryContentSections.first as? ContentRenderSection) - XCTAssertEqual(overviewSection.content.count, 3) + XCTAssertEqual(overviewSection.content.count, 4) XCTAssertEqual(overviewSection.content, [ .heading(.init(level: 2, text: "Overview", anchor: "overview")), - + .paragraph(.init(inlineContent: [.text("This is description with abstract.")])), .paragraph(.init(inlineContent: [ .text("This is a discussion linking to "), .reference(