From f6707bc1b358175d5391cdf124870a6ca55c38c3 Mon Sep 17 00:00:00 2001 From: Wilma Plus <68423050+wilmaplus@users.noreply.github.com> Date: Sat, 9 Jul 2022 00:42:49 +0300 Subject: [PATCH 1/5] Update README.md --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 91fd2dab..e2388015 100644 --- a/README.md +++ b/README.md @@ -1,11 +1,11 @@ -# MarkdownUI +# Flexible MarkdownUI [![CI](https://github.com/gonzalezreal/MarkdownUI/workflows/CI/badge.svg)](https://github.com/gonzalezreal/MarkdownUI/actions?query=workflow%3ACI) [![](https://img.shields.io/endpoint?url=https%3A%2F%2Fswiftpackageindex.com%2Fapi%2Fpackages%2Fgonzalezreal%2FMarkdownUI%2Fbadge%3Ftype%3Dswift-versions)](https://swiftpackageindex.com/gonzalezreal/MarkdownUI) [![](https://img.shields.io/endpoint?url=https%3A%2F%2Fswiftpackageindex.com%2Fapi%2Fpackages%2Fgonzalezreal%2FMarkdownUI%2Fbadge%3Ftype%3Dplatforms)](https://swiftpackageindex.com/gonzalezreal/MarkdownUI) [![contact: @gonzalezreal](https://img.shields.io/badge/contact-@gonzalezreal-blue.svg?style=flat)](https://twitter.com/gonzalezreal) MarkdownUI is a Swift package for rendering Markdown in SwiftUI, fully compliant with the -[CommonMark Spec](https://spec.commonmark.org/current/). +[CommonMark Spec](https://spec.commonmark.org/current/). Our fork supports flexible width, with flexibleWidth in configuration. ## Supported Platforms From 2e8763b09c6b9efff3cea4f7d9d07504ca7d9195 Mon Sep 17 00:00:00 2001 From: Wilma Plus <68423050+wilmaplus@users.noreply.github.com> Date: Sat, 9 Jul 2022 00:53:13 +0300 Subject: [PATCH 2/5] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index e2388015..3b584ab8 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,7 @@ [![](https://img.shields.io/endpoint?url=https%3A%2F%2Fswiftpackageindex.com%2Fapi%2Fpackages%2Fgonzalezreal%2FMarkdownUI%2Fbadge%3Ftype%3Dplatforms)](https://swiftpackageindex.com/gonzalezreal/MarkdownUI) [![contact: @gonzalezreal](https://img.shields.io/badge/contact-@gonzalezreal-blue.svg?style=flat)](https://twitter.com/gonzalezreal) -MarkdownUI is a Swift package for rendering Markdown in SwiftUI, fully compliant with the +Flexible MarkdownUI is a Swift package for rendering Markdown in SwiftUI, fully compliant with the [CommonMark Spec](https://spec.commonmark.org/current/). Our fork supports flexible width, with flexibleWidth in configuration. ## Supported Platforms From 4c7eb8a97535aa0bef1420d4d524f1fc8b43fcdf Mon Sep 17 00:00:00 2001 From: wilmaplus Date: Fri, 8 Jul 2022 21:59:50 +0000 Subject: [PATCH 3/5] Run swift format --- Sources/MarkdownUI/Markdown.swift | 13 ++++++++----- Sources/MarkdownUI/Style/Measurements.swift | 2 +- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/Sources/MarkdownUI/Markdown.swift b/Sources/MarkdownUI/Markdown.swift index fc5ac2c7..25724ef4 100644 --- a/Sources/MarkdownUI/Markdown.swift +++ b/Sources/MarkdownUI/Markdown.swift @@ -1,7 +1,7 @@ -import FlexibleAttributedText import Combine import CombineSchedulers @_exported import CommonMark +import FlexibleAttributedText import SwiftUI /// A view that displays Markdown-formatted text. @@ -227,10 +227,13 @@ public struct Markdown: View { } public var body: some View { - FlexibleAttributedText(self.viewState.attributedString, onOpenLink: openMarkdownLink?.handler, flexibleWidth: style.measurements.flexibleWidth) - .onReceive(self.viewStatePublisher) { viewState in - self.viewState = viewState - } + FlexibleAttributedText( + self.viewState.attributedString, onOpenLink: openMarkdownLink?.handler, + flexibleWidth: style.measurements.flexibleWidth + ) + .onReceive(self.viewStatePublisher) { viewState in + self.viewState = viewState + } } private func loadMarkdownImages(_ hashValue: Int) -> AnyPublisher { diff --git a/Sources/MarkdownUI/Style/Measurements.swift b/Sources/MarkdownUI/Style/Measurements.swift index 9654413c..183dfd6f 100644 --- a/Sources/MarkdownUI/Style/Measurements.swift +++ b/Sources/MarkdownUI/Style/Measurements.swift @@ -26,7 +26,7 @@ extension MarkdownStyle { /// The distance between the bottom of a heading and the top of the next block, relative to the base font size. public var headingSpacing: CGFloat - + public var flexibleWidth: Bool /// Creates a `Measurements` instance. From 91c2077ee2d6a4fdb592f281a7586b47b1f7221e Mon Sep 17 00:00:00 2001 From: Wilma Plus <68423050+wilmaplus@users.noreply.github.com> Date: Sat, 9 Jul 2022 01:03:53 +0300 Subject: [PATCH 4/5] Update Package.resolved --- Package.resolved | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Package.resolved b/Package.resolved index f8c64b31..05cc4fec 100644 --- a/Package.resolved +++ b/Package.resolved @@ -11,12 +11,12 @@ } }, { - "package": "AttributedText", + "package": "FlexibleAttributedText", "repositoryURL": "https://github.com/wilmaplus/FlexibleAttributedText", "state": { "branch": null, - "revision": "2dc2d7864e0fee4b524a5850d7d7cf9a7eeda0fc", - "version": "1.0.0" + "revision": "a3fc604830b0f257276d4db8c98f99866862892b", + "version": "1.1.0" } }, { From 4181398ad7ff946f2f3ac6303e394db35fd2b148 Mon Sep 17 00:00:00 2001 From: Wilma Plus <68423050+wilmaplus@users.noreply.github.com> Date: Sat, 9 Jul 2022 01:06:45 +0300 Subject: [PATCH 5/5] Update README.md --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 3b584ab8..dad2814e 100644 --- a/README.md +++ b/README.md @@ -323,11 +323,11 @@ Markdown( You can add MarkdownUI to an Xcode project by adding it as a package dependency. 1. From the **File** menu, select **Add Packages…** -1. Enter `https://github.com/gonzalezreal/MarkdownUI` into the *Search or Enter Package URL* search +1. Enter `https://github.com/wilmaplus/MarkdownUI` into the *Search or Enter Package URL* search field 1. Link **MarkdownUI** to your application target ## Other Libraries * [CommonMarkAttributedString](https://github.com/mattt/CommonMarkAttributedString) * [Down](https://github.com/johnxnguyen/Down) -* [AttributedText](https://github.com/gonzalezreal/AttributedText) +* [FlexibleAttributedText](https://github.com/wilmaplus/FlexibleAttributedText)