File tree 3 files changed +19
-6
lines changed
Tests/SwiftDocCTests/Semantics/DirectiveInfrastructure
3 files changed +19
-6
lines changed Original file line number Diff line number Diff line change @@ -141,15 +141,17 @@ struct DocumentationMarkup {
141
141
if abstractSection == nil , let firstParagraph = child as? Paragraph {
142
142
abstractSection = AbstractSection ( paragraph: firstParagraph)
143
143
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 {
148
145
if directive. name == DeprecationSummary . directiveName {
146
+ // Found deprecation notice in the abstract.
149
147
deprecation = MarkupContainer ( directive. children)
150
148
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.
152
152
return
153
+ } else {
154
+ currentSection = . discussion
153
155
}
154
156
} else if let _ = child as? HTMLBlock {
155
157
// Skip HTMLBlock comment.
Original file line number Diff line number Diff line change @@ -12,7 +12,7 @@ import Foundation
12
12
import Markdown
13
13
14
14
protocol RenderableDirectiveConvertible : AutomaticDirectiveConvertible where DirectiveType == Self {
15
- associatedtype DirectiveType : AutomaticDirectiveConvertible
15
+ associatedtype DirectiveType
16
16
17
17
func render( with contentCompiler: inout RenderContentCompiler ) -> [ RenderContent ]
18
18
}
Original file line number Diff line number Diff line change @@ -20,6 +20,7 @@ class DirectiveIndexTests: XCTestCase {
20
20
" Assessments " ,
21
21
" Chapter " ,
22
22
" Choice " ,
23
+ " Column " ,
23
24
" DeprecationSummary " ,
24
25
" DisplayName " ,
25
26
" DocumentationExtension " ,
@@ -28,6 +29,7 @@ class DirectiveIndexTests: XCTestCase {
28
29
" Justification " ,
29
30
" Metadata " ,
30
31
" Redirected " ,
32
+ " Row " ,
31
33
" Snippet " ,
32
34
" Stack " ,
33
35
" TechnologyRoot " ,
@@ -38,4 +40,13 @@ class DirectiveIndexTests: XCTestCase {
38
40
]
39
41
)
40
42
}
43
+
44
+ func testDirectiveIndexHasExpectedRenderableDirectives( ) {
45
+ XCTAssertEqual (
46
+ DirectiveIndex . shared. renderableDirectives. keys. sorted ( ) ,
47
+ [
48
+ " Row " ,
49
+ ]
50
+ )
51
+ }
41
52
}
You can’t perform that action at this time.
0 commit comments