File tree Expand file tree Collapse file tree 3 files changed +32
-6
lines changed
Tests/MarkdownTests/Parsing Expand file tree Collapse file tree 3 files changed +32
-6
lines changed Original file line number Diff line number Diff line change 11/*
22 This source file is part of the Swift.org open source project
33
4- Copyright (c) 2021-2023 Apple Inc. and the Swift project authors
4+ Copyright (c) 2021-2025 Apple Inc. and the Swift project authors
55 Licensed under Apache License v2.0 with Runtime Library Exception
66
77 See https://swift.org/LICENSE.txt for license information
@@ -799,9 +799,7 @@ struct ParseContainerStack {
799799
800800 guard !isInBlockDirective else { return false }
801801
802- if case . blockDirective = top {
803- return false
804- } else if case . lineRun( _, isInCodeFence: let codeFence) = top {
802+ if case . lineRun( _, isInCodeFence: let codeFence) = top {
805803 return !codeFence
806804 } else {
807805 return true
Original file line number Diff line number Diff line change 11/*
22 This source file is part of the Swift.org open source project
33
4- Copyright (c) 2021-2023 Apple Inc. and the Swift project authors
4+ Copyright (c) 2021-2025 Apple Inc. and the Swift project authors
55 Licensed under Apache License v2.0 with Runtime Library Exception
66
77 See https://swift.org/LICENSE.txt for license information
Original file line number Diff line number Diff line change 11/*
22 This source file is part of the Swift.org open source project
33
4- Copyright (c) 2023 Apple Inc. and the Swift project authors
4+ Copyright (c) 2023-2025 Apple Inc. and the Swift project authors
55 Licensed under Apache License v2.0 with Runtime Library Exception
66
77 See https://swift.org/LICENSE.txt for license information
@@ -436,4 +436,32 @@ class DoxygenCommandParserTests: XCTestCase {
436436 """#
437437 XCTAssertEqual ( document. debugDescription ( ) , expectedDump)
438438 }
439+
440+ func testRunOnDirectivesAllowDoxygenParsing( ) {
441+ let source = #"""
442+ @method doSomethingWithNumber:
443+ @abstract Some brief description of this method
444+ @param number Some description of the "number" parameter
445+ @return Some description of the return value
446+ @discussion Some longer discussion for this method
447+ """#
448+
449+ let document = Document ( parsing: source, options: parseOptions)
450+
451+ let expectedDump = #"""
452+ Document
453+ ├─ BlockDirective name: "method"
454+ ├─ BlockDirective name: "abstract"
455+ ├─ DoxygenParameter parameter: number
456+ │ └─ Paragraph
457+ │ └─ Text "Some description of the “number” parameter"
458+ ├─ DoxygenReturns
459+ │ └─ Paragraph
460+ │ └─ Text "Some description of the return value"
461+ └─ DoxygenDiscussion
462+ └─ Paragraph
463+ └─ Text "Some longer discussion for this method"
464+ """#
465+ XCTAssertEqual ( document. debugDescription ( ) , expectedDump)
466+ }
439467}
You can’t perform that action at this time.
0 commit comments