The TSMarkdownParser is a powerful and easy-to-use library for parsing and rendering Markdown in your iOS and Mac applications. It allows you to effortlessly convert Markdown text into beautifully formatted and styled HTML content.


  • Supports standard Markdown syntax.
  • Fast and efficient parsing.
  • Ability to customize the appearance and styling of the rendered HTML.
  • Supports advanced features like tables, code blocks, and math equations.
  • Handles various types of media embedding, such as images and YouTube videos.
  • Compatible with iOS and Mac applications.

Getting Started


To use the TSMarkdownParser library in your project, you can follow these steps:

  1. Open your project in Xcode.
  2. Go to your project’s target settings.
  3. Select “Build Phases”.
  4. Expand the “Link Binary With Libraries” section.
  5. Click on the “+” button and add “TSMarkdownParser.framework”.


Importing the Library

To start using the TSMarkdownParser library, import it into your Swift file:

import TSMarkdownParser

Parsing Markdown

You can parse Markdown text into HTML using the following method:

let markdownString = “Hello, **World!**”
let htmlString = TSMarkdownParser.standard.parse(markdownString)

Customizing the Appearance

You can customize the appearance and styling of the rendered HTML by using the various configuration options provided by the library. For example, you can change the font, color, or add custom CSS classes to specific elements.

let parser = TSMarkdownParser.standard
parser.headingAttributes = [
.font: UIFont.boldSystemFont(ofSize: 18),
.foregroundColor: UIColor.blue

let htmlString = parser.parse(markdownString)

Advanced Features


TSMarkdownParser supports creating tables in Markdown. Here’s an example:

| Name | Age | City |
| John | 25 | New York |
| Emily | 30 | San Francisco |

Code Blocks

You can include code blocks in your Markdown using backticks (“`). Specify the programming language to enable syntax highlighting.

func helloWorld() {
print(“Hello, World!”)

Media Embedding

You can easily embed media such as images and YouTube videos into your Markdown:

– Embedding an image:
![Alt Text](http://example.com/image.jpg)

– Embedding a YouTube video:


Here are some examples to demonstrate the usage of TSMarkdownParser:

Example 1

Converting Markdown to HTML:

let markdownString = “Here is some **bold** and _italic_ text.”
let htmlString = TSMarkdownParser.standard.parse(markdownString)

Example 2

Using advanced features like code blocks:

let markdownString = ““`swift\nfunc helloWorld() {\n print(\”Hello, World!\”)\n}\n“`”
let htmlString = TSMarkdownParser.standard.parse(markdownString)


The TSMarkdownParser library provides an easy and efficient way to parse and render Markdown in your iOS and Mac applications. With its support for standard Markdown syntax, customization options, and advanced features, you can effortlessly convert Markdown text into beautifully formatted HTML content.

For more information and detailed documentation, please visit the TSMarkdownParser website.