Skip to content

Commit 1a1a95e

Browse files
committed
Test updates
1 parent 2dee824 commit 1a1a95e

File tree

3 files changed

+19
-6
lines changed

3 files changed

+19
-6
lines changed

Sources/SwiftDocC/Model/DocumentationMarkup.swift

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -141,15 +141,17 @@ struct DocumentationMarkup {
141141
if abstractSection == nil, let firstParagraph = child as? Paragraph {
142142
abstractSection = AbstractSection(paragraph: firstParagraph)
143143
return
144-
} else if let directive = child as? BlockDirective,
145-
directive.name == DeprecationSummary.directiveName
146-
{
147-
// Found deprecation notice in the abstract.
144+
} else if let directive = child as? BlockDirective {
148145
if directive.name == DeprecationSummary.directiveName {
146+
// Found deprecation notice in the abstract.
149147
deprecation = MarkupContainer(directive.children)
150148
return
151-
} else if directive.name == Comment.directiveName {
149+
} else if directive.name == Comment.directiveName || directive.name == Metadata.directiveName {
150+
// These directives don't affect content so they shouldn't break us out of
151+
// the automatic abstract section.
152152
return
153+
} else {
154+
currentSection = .discussion
153155
}
154156
} else if let _ = child as? HTMLBlock {
155157
// Skip HTMLBlock comment.

Sources/SwiftDocC/Model/Rendering/RenderContentConvertible.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import Foundation
1212
import Markdown
1313

1414
protocol RenderableDirectiveConvertible: AutomaticDirectiveConvertible where DirectiveType == Self {
15-
associatedtype DirectiveType: AutomaticDirectiveConvertible
15+
associatedtype DirectiveType
1616

1717
func render(with contentCompiler: inout RenderContentCompiler) -> [RenderContent]
1818
}

Tests/SwiftDocCTests/Semantics/DirectiveInfrastructure/DirectiveIndexTests.swift

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ class DirectiveIndexTests: XCTestCase {
2020
"Assessments",
2121
"Chapter",
2222
"Choice",
23+
"Column",
2324
"DeprecationSummary",
2425
"DisplayName",
2526
"DocumentationExtension",
@@ -28,6 +29,7 @@ class DirectiveIndexTests: XCTestCase {
2829
"Justification",
2930
"Metadata",
3031
"Redirected",
32+
"Row",
3133
"Snippet",
3234
"Stack",
3335
"TechnologyRoot",
@@ -38,4 +40,13 @@ class DirectiveIndexTests: XCTestCase {
3840
]
3941
)
4042
}
43+
44+
func testDirectiveIndexHasExpectedRenderableDirectives() {
45+
XCTAssertEqual(
46+
DirectiveIndex.shared.renderableDirectives.keys.sorted(),
47+
[
48+
"Row",
49+
]
50+
)
51+
}
4152
}

0 commit comments

Comments
 (0)