Skip to content

Commit 6e8aa03

Browse files
authored
Revert "Bump Swift version (#4)"
This reverts commit 6d11986.
1 parent df90f9f commit 6e8aa03

File tree

7 files changed

+53
-95
lines changed

7 files changed

+53
-95
lines changed

.gitignore

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,5 +10,3 @@
1010
/.build
1111
/Packages
1212
/*.xcodeproj
13-
.swiftpm
14-
Package.resolved

Package.swift

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// swift-tools-version:5.3
1+
// swift-tools-version:4.2
22
/*
33
This source file is part of the Swift.org open source project
44

@@ -25,21 +25,13 @@ let package = Package(
2525
targets: [
2626
.target(
2727
name: "Markdown",
28-
dependencies: [
29-
"CAtomic",
30-
.product(name: "cmark-gfm", package: "swift-cmark"),
31-
.product(name: "cmark-gfm-extensions", package: "swift-cmark"),
32-
]),
28+
dependencies: ["cmark-gfm", "cmark-gfm-extensions", "CAtomic"]),
3329
.target(
3430
name: "markdown-tool",
35-
dependencies: [
36-
"Markdown",
37-
.product(name: "ArgumentParser", package: "swift-argument-parser")
38-
]),
31+
dependencies: ["Markdown", .product(name: "ArgumentParser", package: "swift-argument-parser")]),
3932
.testTarget(
4033
name: "MarkdownTests",
41-
dependencies: ["Markdown"],
42-
resources: [.process("Visitors/Everything.md")]),
34+
dependencies: ["Markdown"]),
4335
.target(name: "CAtomic"),
4436
]
4537
)

[email protected]

Lines changed: 0 additions & 64 deletions
This file was deleted.

Tests/MarkdownTests/Visitors/Everything.md

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,19 +13,15 @@
1313
> BlockQuote
1414
1515
```swift
16-
func foo() {
17-
let x = 1
18-
}
16+
func foo() { let x = 1 }
1917
```
2018

21-
// Is this real code? Or just fantasy?
22-
2319
This is an <topic://autolink>.
2420

2521
---
2622

2723
<a href="foo.png">
28-
An HTML Block.
24+
An HTML Block.
2925
</a>
3026

3127
This is some <p>inline html</p>.

Tests/MarkdownTests/Visitors/MarkupRewriterTests.swift

Lines changed: 39 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,45 @@ import XCTest
1212
@testable import Markdown
1313

1414
/// A `Document` that has every kind of element in it at least once.
15-
let everythingDocument = Document(parsing: try! String(contentsOf: Bundle.module.url(forResource: "Everything", withExtension: "md")!))
15+
let everythingDocument = Document(parsing: """
16+
# Header
17+
18+
*Emphasized* **strong** `inline code` [link](foo) ![image](foo).
19+
20+
- this
21+
- is
22+
- a
23+
- list
24+
25+
1. eggs
26+
1. milk
27+
28+
> BlockQuote
29+
30+
```swift
31+
func foo() {
32+
let x = 1
33+
}
34+
```
35+
36+
// Is this real code? Or just fantasy?
37+
38+
This is an <topic://autolink>.
39+
40+
---
41+
42+
<a href="foo.png">
43+
An HTML Block.
44+
</a>
45+
46+
This is some <p>inline html</p>.
47+
48+
line
49+
break
50+
51+
soft
52+
break
53+
""")
1654

1755

1856
class MarkupRewriterTests: XCTestCase {

Tests/MarkdownTests/Visitors/MarkupTreeDumperTests.swift

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ import XCTest
1414
final class MarkupTreeDumperTests: XCTestCase {
1515
func testDumpEverything() {
1616
let expectedDump = """
17-
Document @1:1-39:90 Root #\(everythingDocument.raw.metadata.id.rootId) #0
17+
Document @1:1-37:6 Root #\(everythingDocument.raw.metadata.id.rootId) #0
1818
├─ Heading @1:1-1:9 #1 level: 1
1919
│ └─ Text @1:3-1:9 #2 "Header"
2020
├─ Paragraph @3:1-3:65 #3
@@ -52,8 +52,8 @@ final class MarkupTreeDumperTests: XCTestCase {
5252
│ └─ ListItem @11:1-12:1 #35
5353
│ └─ Paragraph @11:4-11:8 #36
5454
│ └─ Text @11:4-11:8 #37 "milk"
55-
├─ BlockQuote @13:1-13:13 #38
56-
│ └─ Paragraph @13:3-13:13 #39
55+
├─ BlockQuote @13:1-13:14 #38
56+
│ └─ Paragraph @13:3-13:14 #39
5757
│ └─ Text @13:3-13:13 #40 "BlockQuote"
5858
├─ CodeBlock @15:1-19:4 #41 language: swift
5959
│ func foo() {
@@ -81,12 +81,10 @@ final class MarkupTreeDumperTests: XCTestCase {
8181
│ ├─ Text @33:1-33:7 #57 "line"
8282
│ ├─ LineBreak #58
8383
│ └─ Text @34:1-34:6 #59 "break"
84-
├─ Paragraph @36:1-37:6 #60
85-
│ ├─ Text @36:1-36:5 #61 "soft"
86-
│ ├─ SoftBreak #62
87-
│ └─ Text @37:1-37:6 #63 "break"
88-
└─ HTMLBlock @39:1-39:90 #64
89-
<!-- Copyright (c) 2021 Apple Inc and the Swift Project authors. All Rights Reserved. -->
84+
└─ Paragraph @36:1-37:6 #60
85+
├─ Text @36:1-36:5 #61 "soft"
86+
├─ SoftBreak #62
87+
└─ Text @37:1-37:6 #63 "break"
9088
"""
9189
print(everythingDocument.debugDescription(options: [.printEverything]))
9290
XCTAssertEqual(expectedDump, everythingDocument.debugDescription(options: [.printEverything]))

bin/check-source

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ for language in swift-or-c bash md-or-tutorial html docker; do
4949
reader=head
5050
case "$language" in
5151
swift-or-c)
52-
exceptions=( -name 'Package*.swift')
52+
exceptions=( -name Package.swift)
5353
matching_files=( -name '*.swift' -o -name '*.c' -o -name '*.h' )
5454
cat > "$tmp" <<"EOF"
5555
/*

0 commit comments

Comments
 (0)