File tree Expand file tree Collapse file tree 3 files changed +14
-11
lines changed
Expand file tree Collapse file tree 3 files changed +14
-11
lines changed Original file line number Diff line number Diff line change 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(
323323You can add MarkdownUI to an Xcode project by adding it as a package dependency.
324324
3253251 . 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
3283281 . 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 )
Original file line number Diff line number Diff line change 1- import FlexibleAttributedText
21import Combine
32import CombineSchedulers
43@_exported import CommonMark
4+ import FlexibleAttributedText
55import 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 > {
Original file line number Diff line number Diff 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.
You can’t perform that action at this time.
0 commit comments