Skip to content

Commit 721b1f0

Browse files
committed
Add Markdown snapshot tests
1 parent 7e67742 commit 721b1f0

File tree

140 files changed

+352
-2320
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

140 files changed

+352
-2320
lines changed

Examples/MarkdownUIDemo/MarkdownUIDemo.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved

Lines changed: 5 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ test:
1010
xcodebuild test \
1111
-scheme MarkdownUI-Package \
1212
-destination '$(DESTINATION_MAC)'
13-
xcodebuild test \
13+
xcodebuild \
1414
-scheme MarkdownUI-Package \
1515
-destination '$(DESTINATION_CATALYST)'
1616
xcodebuild test \

Package.resolved

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Package.swift

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ let package = Package(
3434
.package(
3535
name: "AttributedText",
3636
url: "https://github.com/gonzalezreal/AttributedText",
37-
from: "0.1.6"
37+
from: "0.2.0"
3838
),
3939
.package(
4040
name: "NetworkImage",
@@ -74,10 +74,7 @@ let package = Package(
7474
"MarkdownUI",
7575
"SnapshotTesting",
7676
],
77-
exclude: [
78-
"__Fixtures__",
79-
"__Snapshots__",
80-
]
77+
exclude: ["__Snapshots__"]
8178
),
8279
]
8380
)

Sources/MarkdownUI/Shared/MarkdownStore.swift

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -27,20 +27,17 @@
2727

2828
self.document = document
2929
self.environment = environment
30-
updateAttributedText()
30+
renderAttributedText()
3131
}
3232

3333
func onEnvironmentChange(_ environment: Environment) {
3434
guard self.environment != environment else { return }
3535

3636
self.environment = environment
37-
updateAttributedText()
37+
renderAttributedText()
3838
}
39-
}
4039

41-
@available(macOS 10.15, iOS 13.0, tvOS 13.0, *)
42-
private extension MarkdownStore {
43-
func updateAttributedText() {
40+
private func renderAttributedText() {
4441
guard let document = self.document, let environment = self.environment else {
4542
attributedText = NSAttributedString()
4643
return

0 commit comments

Comments
 (0)