Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

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

Sign up

.Net basic markdown to RTF converter

NotificationsYou must be signed in to change notification settings

GustavoHennig/MarkdownToRtf

Repository files navigation

MarkdownToRtf is a basic C# library that converts Markdown to RTF (Rich Text Format). It supports standard Markdown elements such as headings, bold, italic, underline, lists, and more.

Features

  • Markdown parsing: Converts Markdown syntax into RTF.
  • Standard elements:
    • Headings (# Heading 1,## Heading 2, etc.)
    • Bold (**bold**)
    • Italic (*italic*)
    • Underline (__underline__)
    • Ordered and unordered lists (1. Item,- Bullet)
  • RTF output: Generates a valid RTF string that can be saved to a file or rendered in controls likeRichTextBox.

Usage

Basic Example

usingMarkdownToRtf;classProgram{staticvoidMain(){stringmarkdown=@"# Heading 1This is **bold**, *italic*, and __underline__ text.1. First item2. Second item- Bullet 1- Bullet 2";stringrtf=MarkdownToRtfConverter.Convert(markdown);Console.WriteLine(rtf);// Save to file or use in a RichTextBox}}

Output

Input Markdown:

#Heading 1This is**bold**,*italic*, and__underline__ text.1. First item2. Second item- Bullet 1- Bullet 2

Output RTF (simplified for readability):

{\rtf1\ansi\deff0\pard\sa180\fs30\b Heading 1\b0\par\pard\This is\b bold\b0 ,\i italic\i0 , and\ul underline\ulnone  text.\par\pard\1. First item\par\pard\2. Second item\par\pard\\bullet Bullet 1\par\pard\\bullet Bullet 2\par}

Requirements

  • .NET 6 or higher (check the csproj)
  • Markdig (Markdown parser)

License

This project is licensed under theMIT License.

About

.Net basic markdown to RTF converter

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages


[8]ページ先頭

©2009-2025 Movatter.jp