Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Releases: gonzalezreal/swift-markdown-ui

MarkdownUI 2.4.1

13 Oct 08:52
5f61335

Choose a tag to compare

What's Changed

Full Changelog: 2.4.0...2.4.1

MarkdownUI 2.4.0

13 Aug 07:07
5544181

Choose a tag to compare

What's Changed

New Contributors

Full Changelog: 2.3.1...2.4.0

MarkdownUI 2.3.1

16 Jun 09:01
9a8119b

Choose a tag to compare

What's Changed

New Contributors

Full Changelog: 2.3.0...2.3.1

MarkdownUI 2.3.0

01 Jan 14:48
ae799d0

Choose a tag to compare

What's Changed

  • Added: Mac Catalyst support (#287)
  • Added: FontWidth, a text style that adjusts the font width (thanks @kirkbig #266)
  • Changed: Use #if canImport(...) instead of #if os(...) (thanks @MojtabaHs #268)
  • Fixed: Mac Catalyst build failures (thanks @kirkbig #283)
  • Changed: Use assertSnapshot(of:...) instead of the deprecated assertSnapshot(matching:...) (thanks @kirkbig #284)

Full Changelog: 2.2.0...2.3.0

MarkdownUI 2.2.0

10 Sep 07:49
5df8a4a

Choose a tag to compare

What's Changed

  • Fixed: Apply the current text style foreground color to code blocks (#228)
  • Fixed: Unexpected code block truncation (#256)
  • Added: Support for visionOS (thanks @Rminsh, #252)
  • Infra: Adopt gonzalezreal/NetworkImage as the default image provider (#258)
  • Added: MarkdownContent HTML rendering (thanks @srna, #253)
  • Infra: Enable text selection in Demo (#259)

New Contributors

Full Changelog: 2.1.0...2.2.0

MarkdownUI 2.1.0

15 Apr 12:57
12b351a

Choose a tag to compare

What's Changed

  • Infrastructure: Refactor Markdown parsing (#210)
  • Infrastructure: Bump CI workflow's Xcode to 14.2 (#212)
  • Fixed: Deprecation message (#214)
  • Added: Provide access to the language and the content of a code block from the body of the codeBlock style (#215)
  • Added: Provide access to the block's Markdown content from the body of most of the block styles (#220)
  • Added: Render HTML line breaks <br> (#221)
  • Changed: Move the fixedSize modifier from the paragraph view to the block style in all the bundled themes (#222)

Full Changelog: 2.0.2...2.1.0

MarkdownUI 2.0.2

16 Mar 07:44
4392c3c

Choose a tag to compare

What's Changed

Full Changelog: 2.0.1...2.0.2

MarkdownUI 2.0.1

05 Feb 07:57
5e15c0d

Choose a tag to compare

What's Changed

Full Changelog: 2.0.0...2.0.1

MarkdownUI 2.0.0

22 Jan 17:05

Choose a tag to compare

Overview

MarkdownUI 2 has been rewritten from scratch and brings a ton of new features and improvements
like:

  • GitHub Flavored Markdown (tables, task lists, strikethrough text, and autolinks)
  • Native SwiftUI rendering
  • Customization support via themes, text styles, and block styles.

These new features come with the cost of a few breaking changes that these notes will help you to
address.

Minimum requirements

You can use MarkdownUI 2 on the following platforms:

  • macOS 12.0+
  • iOS 15.0+
  • tvOS 15.0+
  • watchOS 8.0+

Some features, like displaying tables or multi-image paragraphs, require macOS 13.0+, iOS 16.0+,
tvOS 16.0+, and watchOS 9.0+.

Updated package name

To reflect the Swift community naming conventions, the package has been renamed from MarkdownUI to swift-markdown-ui. So, you may eventually need to update any Xcode projects or Package.swift files that depend on MarkdownUI.

Rendering

MarkdownUI 2 uses SwiftUI primitives to render Markdown and no longer depends on gonzalezreal/AttributedText.

Creating Markdown content

MarkdownUI 2 introduces a new domain-specific language to create Markdown content and no longer
depends on gonzalezreal/SwiftCommonMark.

One significant difference when using MarkdownUI 2 is that MarkdownContent replaces Document
by providing similar functionality.

Another thing to be aware of is the different naming of some of the types you use to compose
Markdown content:

  • Use Blockquote instead of BlockQuote.
  • Use NumberedList instead of OrderedList.
  • Use BulletedList instead of BulletList.
  • Use InlineImage instead of Image.
  • Use InlineLink instead of Link.
  • Use Code instead of InlineCode.

Loading asset images

MarkdownUI 2 introduces the ImageProvider protocol and its conforming types
DefaultImageProvider and AssetImageProvider. These types and the new
markdownImageProvider(_:) modifier replace the MarkdownImageHandler type and
the setImageHandler(_:forURLScheme:) modifier.

The following example shows how to configure the asset image provider to load images from the
main bundle.

Markdown {
  "![A dog](dog)"
  "― Photo by André Spieker"
}
.markdownImageProvider(.asset)

Customizing link behavior

The onOpenMarkdownLink(perform:) modifier in MarkdownUI 1.x was provided to enable link behavior
customization in macOS 11.0, iOS 14.0, and tvOS 14.0. This modifier is no longer available in
MarkdownUI 2 since it does not support those platforms. However, you can customize the link
behavior by setting the openURL environment value with a custom OpenURLAction.

Styling Markdown

MarkdownUI 1.x offered a few options to customize the content appearance. In contrast, MarkdownUI 2
brings the new Theme, TextStyle, and BlockStyle types that let you apply a custom
appearance to blocks and text inlines in a Markdown view.

Consequently, the MarkdownStyle type, all of its subtypes, and the markdownStyle(_:) modifier
are no longer available in MarkdownUI 2.

MarkdownUI 1.1.1

22 Jul 16:29
6a33c60

Choose a tag to compare

What's Changed

Full Changelog: 1.1.0...1.1.1

Morty Proxy This is a proxified and sanitized view of the page, visit original site.