Bump to 1.6.2 (16) !134

merged merged by cmc on 2026-09-23 03:35 UTC · krz/gitbay-ios:bump-1.6.2 into main

3 files changed, +10 −75

Layout: unified · split

gitbay.xcodeproj/project.pbxproj +4 −4
@@ -415,7 +415,7 @@
415415 ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;
416416 CODE_SIGN_ENTITLEMENTS = gitbay/gitbay.entitlements;
417417 CODE_SIGN_STYLE = Automatic;
418 CURRENT_PROJECT_VERSION = 15;
418 CURRENT_PROJECT_VERSION = 16;
419419 DEVELOPMENT_TEAM = ZCNAX3VL9D;
420420 ENABLE_PREVIEWS = YES;
421421 GENERATE_INFOPLIST_FILE = YES;
@@ -431,7 +431,7 @@
431431 "$(inherited)",
432432 "@executable_path/Frameworks",
433433 );
434 MARKETING_VERSION = 1.6.1;
434 MARKETING_VERSION = 1.6.2;
435435 PRODUCT_BUNDLE_IDENTIFIER = org.gitbay.gitbay;
436436 PRODUCT_NAME = "$(TARGET_NAME)";
437437 STRING_CATALOG_GENERATE_SYMBOLS = YES;
@@ -451,7 +451,7 @@
451451 ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;
452452 CODE_SIGN_ENTITLEMENTS = gitbay/gitbay.entitlements;
453453 CODE_SIGN_STYLE = Automatic;
454 CURRENT_PROJECT_VERSION = 15;
454 CURRENT_PROJECT_VERSION = 16;
455455 DEVELOPMENT_TEAM = ZCNAX3VL9D;
456456 ENABLE_PREVIEWS = YES;
457457 GENERATE_INFOPLIST_FILE = YES;
@@ -467,7 +467,7 @@
467467 "$(inherited)",
468468 "@executable_path/Frameworks",
469469 );
470 MARKETING_VERSION = 1.6.1;
470 MARKETING_VERSION = 1.6.2;
471471 PRODUCT_BUNDLE_IDENTIFIER = org.gitbay.gitbay;
472472 PRODUCT_NAME = "$(TARGET_NAME)";
473473 STRING_CATALOG_GENERATE_SYMBOLS = YES;
gitbay/Views/Repos/MarkdownView.swift +6 −31
@@ -86,14 +86,9 @@ struct MarkdownView: View {
8686 }
8787 if trimmed.hasPrefix("- ") || trimmed.hasPrefix("* ") || trimmed.hasPrefix("+ ") {
8888 var items: [String] = []
89 while let next = lines.first?.trimmingCharacters(in: .whitespaces) {
90 if next.hasPrefix("- ") || next.hasPrefix("* ") || next.hasPrefix("+ ") {
91 items.append(String(next.dropFirst(2)))
92 } else if Self.continuesItem(lines) {
93 items[items.count - 1] += " " + next
94 } else {
95 break
96 }
89 while let next = lines.first?.trimmingCharacters(in: .whitespaces),
90 next.hasPrefix("- ") || next.hasPrefix("* ") || next.hasPrefix("+ ") {
91 items.append(String(next.dropFirst(2)))
9792 lines = lines.dropFirst()
9893 }
9994 blocks.append(.bullet(items))
@@ -101,14 +96,9 @@ struct MarkdownView: View {
10196 }
10297 if trimmed.range(of: #"^\d+\. "#, options: .regularExpression) != nil {
10398 var items: [String] = []
104 while let next = lines.first?.trimmingCharacters(in: .whitespaces) {
105 if let range = next.range(of: #"^\d+\. "#, options: .regularExpression) {
106 items.append(String(next[range.upperBound...]))
107 } else if Self.continuesItem(lines) {
108 items[items.count - 1] += " " + next
109 } else {
110 break
111 }
99 while let next = lines.first?.trimmingCharacters(in: .whitespaces),
100 let range = next.range(of: #"^\d+\. "#, options: .regularExpression) {
101 items.append(String(next[range.upperBound...]))
112102 lines = lines.dropFirst()
113103 }
114104 blocks.append(.ordered(items))
@@ -150,19 +140,6 @@ struct MarkdownView: View {
150140 return blocks
151141 }
152142
153 /// A line that wraps the list item above it: anything but a blank line or
154 /// the start of another block, indented or not, as in CommonMark.
155 private static func continuesItem(_ lines: ArraySlice<String>) -> Bool {
156 guard let line = lines.first?.trimmingCharacters(in: .whitespaces), !line.isEmpty
157 else { return false }
158 let startsBlock = line.hasPrefix("#") || line.hasPrefix("```") || line.hasPrefix(">")
159 || line.hasPrefix("- ") || line.hasPrefix("* ") || line.hasPrefix("+ ")
160 || line == "---" || line == "***" || line == "___"
161 || line.range(of: #"^\d+\. "#, options: .regularExpression) != nil
162 || tableStart(lines) != nil
163 return !startsBlock
164 }
165
166143 // MARK: - Tables
167144
168145 /// A table begins where a row of cells is followed by a separator row with the
@@ -247,7 +224,6 @@ struct MarkdownView: View {
247224 HStack(alignment: .firstTextBaseline, spacing: 8) {
248225 Text("•")
249226 Self.inline(item, linkOptions: linkOptions)
250 .fixedSize(horizontal: false, vertical: true)
251227 }
252228 }
253229 }
@@ -257,7 +233,6 @@ struct MarkdownView: View {
257233 HStack(alignment: .firstTextBaseline, spacing: 8) {
258234 Text("\(index + 1).").monospacedDigit()
259235 Self.inline(item, linkOptions: linkOptions)
260 .fixedSize(horizontal: false, vertical: true)
261236 }
262237 }
263238 }
gitbayTests/MarkdownTests.swift −40
@@ -135,43 +135,3 @@ struct MarkdownLinkTests {
135135 == ["ARCHITECTURE.md"])
136136 }
137137}
138
139@MainActor
140struct MarkdownListTests {
141
142 private func blocks(_ markdown: String) -> [MarkdownView.Block] {
143 MarkdownView(markdown: markdown).blocks
144 }
145
146 @Test func indentedContinuationLinesStayInTheItem() {
147 let parsed = blocks("""
148 - Org source files in `content/`.
149 That directory is the URL root.
150 - HTML templates.
151 """)
152 #expect(parsed == [.bullet([
153 "Org source files in `content/`. That directory is the URL root.",
154 "HTML templates.",
155 ])])
156 }
157
158 @Test func unindentedContinuationLinesStayInTheItem() {
159 let parsed = blocks("- one\ncontinued\n- two")
160 #expect(parsed == [.bullet(["one continued", "two"])])
161 }
162
163 @Test func orderedItemsTakeContinuationLines() {
164 let parsed = blocks("1. first\n more\n2. second")
165 #expect(parsed == [.ordered(["first more", "second"])])
166 }
167
168 @Test func aListEndsAtABlankLine() {
169 let parsed = blocks("- one\n\nAfter the list.")
170 #expect(parsed == [.bullet(["one"]), .paragraph("After the list.")])
171 }
172
173 @Test func aHeadingEndsAList() {
174 let parsed = blocks("- one\n## Next")
175 #expect(parsed == [.bullet(["one"]), .heading(level: 2, text: "Next")])
176 }
177}