Skip to content

Commit 9b3aa0e

Browse files
Merge remote-tracking branch 'refs/remotes/origin/main'
Conflicts: Package.resolved
2 parents 10828ea + 4181398 commit 9b3aa0e

File tree

3 files changed

+14
-11
lines changed

3 files changed

+14
-11
lines changed

README.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
# MarkdownUI
1+
# Flexible MarkdownUI
22
[![CI](https://github.com/gonzalezreal/MarkdownUI/workflows/CI/badge.svg)](https://github.com/gonzalezreal/MarkdownUI/actions?query=workflow%3ACI)
33
[![](https://img.shields.io/endpoint?url=https%3A%2F%2Fswiftpackageindex.com%2Fapi%2Fpackages%2Fgonzalezreal%2FMarkdownUI%2Fbadge%3Ftype%3Dswift-versions)](https://swiftpackageindex.com/gonzalezreal/MarkdownUI)
44
[![](https://img.shields.io/endpoint?url=https%3A%2F%2Fswiftpackageindex.com%2Fapi%2Fpackages%2Fgonzalezreal%2FMarkdownUI%2Fbadge%3Ftype%3Dplatforms)](https://swiftpackageindex.com/gonzalezreal/MarkdownUI)
55
[![contact: @gonzalezreal](https://img.shields.io/badge/contact-@gonzalezreal-blue.svg?style=flat)](https://twitter.com/gonzalezreal)
66

7-
MarkdownUI is a Swift package for rendering Markdown in SwiftUI, fully compliant with the
8-
[CommonMark Spec](https://spec.commonmark.org/current/).
7+
Flexible MarkdownUI is a Swift package for rendering Markdown in SwiftUI, fully compliant with the
8+
[CommonMark Spec](https://spec.commonmark.org/current/). Our fork supports flexible width, with flexibleWidth in configuration.
99

1010
## Supported Platforms
1111

@@ -323,11 +323,11 @@ Markdown(
323323
You can add MarkdownUI to an Xcode project by adding it as a package dependency.
324324

325325
1. From the **File** menu, select **Add Packages…**
326-
1. Enter `https://github.com/gonzalezreal/MarkdownUI` into the *Search or Enter Package URL* search
326+
1. Enter `https://github.com/wilmaplus/MarkdownUI` into the *Search or Enter Package URL* search
327327
field
328328
1. Link **MarkdownUI** to your application target
329329

330330
## Other Libraries
331331
* [CommonMarkAttributedString](https://github.com/mattt/CommonMarkAttributedString)
332332
* [Down](https://github.com/johnxnguyen/Down)
333-
* [AttributedText](https://github.com/gonzalezreal/AttributedText)
333+
* [FlexibleAttributedText](https://github.com/wilmaplus/FlexibleAttributedText)

Sources/MarkdownUI/Markdown.swift

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
import FlexibleAttributedText
21
import Combine
32
import CombineSchedulers
43
@_exported import CommonMark
4+
import FlexibleAttributedText
55
import SwiftUI
66

77
/// A view that displays Markdown-formatted text.
@@ -227,10 +227,13 @@ public struct Markdown: View {
227227
}
228228

229229
public var body: some View {
230-
FlexibleAttributedText(self.viewState.attributedString, onOpenLink: openMarkdownLink?.handler, flexibleWidth: style.measurements.flexibleWidth)
231-
.onReceive(self.viewStatePublisher) { viewState in
232-
self.viewState = viewState
233-
}
230+
FlexibleAttributedText(
231+
self.viewState.attributedString, onOpenLink: openMarkdownLink?.handler,
232+
flexibleWidth: style.measurements.flexibleWidth
233+
)
234+
.onReceive(self.viewStatePublisher) { viewState in
235+
self.viewState = viewState
236+
}
234237
}
235238

236239
private func loadMarkdownImages(_ hashValue: Int) -> AnyPublisher<ViewState, Never> {

Sources/MarkdownUI/Style/Measurements.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ extension MarkdownStyle {
2626

2727
/// The distance between the bottom of a heading and the top of the next block, relative to the base font size.
2828
public var headingSpacing: CGFloat
29-
29+
3030
public var flexibleWidth: Bool
3131

3232
/// Creates a `Measurements` instance.

0 commit comments

Comments
 (0)