Switch branches/tags
Nothing to show
Find file History
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.



The Waher.Content.Markdown library is a Markdown parser written in C#. The library can, apart from parsing Markdown, also export to HTML and XAML, which makes it suitable for server-side CMS applictions, as well as client-side applications working with markdown. It's part of the IoTGateway solution.

For an online reference to the markdown syntax supported by the library, see https://waher.se/Markdown.md


You should carefully read the following terms and conditions before using this software. Your use of this software indicates your acceptance of this license agreement and warranty. If you do not agree with the terms of this license, or if the terms of this license contradict with your local laws, you must remove any files from the IoT Gateway from your storage devices and cease to use it. The terms of this license are subjects of changes in future versions of the IoT Gateway.

You may not use, copy, emulate, clone, rent, lease, sell, modify, decompile, disassemble, otherwise reverse engineer, or transfer the licensed program, or any subset of the licensed program, except as provided for in this agreement. Any such unauthorised use shall result in immediate and automatic termination of this license and may result in criminal and/or civil prosecution.

The source code and libraries provided in this repository is provided open for the following uses:

  • For Personal evaluation. Personal evaluation means evaluating the code, its libraries and underlying technologies, including learning about underlying technologies.

  • For Academic use. If you want to use the following code for academic use, all you need to do is to inform the author of who you are, what academic institution you work for (or study for), and in what projects you intend to use the code. All I ask in return is for an acknowledgement and visible attribution to this repository, including a link, and that you do not redistribute the source code, or parts thereof in the solutions you develop. Any solutions developed for academic use, that become commercial, require a commercial license.

  • For Security analysis. If you perform any security analysis on the code, to see what security aspects the code might have, all that is asked of you, is that you inform the author of any findings at least forty-five days before publication of the findings, so that any vulnerabilities might be addressed. Such contributions are much appreciated and will be acknowledged.

Commercial use of the code, in part or in full, in compiled binary form, or its source code, requires a Commercial License. Contact the author for details.

All rights to the source code are reserved and exclusively owned by Waher Data AB. Any contributions made to the IoT Gateway repository become the intellectual property of Waher Data AB. If you're interested in using the source code, as a whole, or in part, you need a license agreement with the author. You can contact him through LinkedIn.

This software is provided by the copyright holder and contributors "as is" and any express or implied warranties, including, but not limited to, the implied warranties of merchantability and fitness for a particular purpose are disclaimed. In no event shall the copyright owner or contributors be liable for any direct, indirect, incidental, special, exemplary, or consequential damages (including, but not limited to, procurement of substitute goods or services; loss of use, data, or profits; or business interruption) however caused and on any theory of liability, whether in contract, strict liability, or tort (including negligence or otherwise) arising in any way out of the use of this software, even if advised of the possibility of such damage.

The IoT Gateway is © Waher Data AB 2016-2018. All rights reserved.


Following is a simple example in C# on how to parse markdown text, export it to XAML and then convert it to a UIElement for display:

Emoji1LocalFiles Emoji1_24x24 = new Emoji1LocalFiles(Emoji1SourceFileType.Png64, 24, 24, "pack://siteoforigin:,,,/Graphics/Emoji1/png/64x64/%FILENAME%");
MarkdownDocument Markdown = new MarkdownDocument(Text, new MarkdownSettings(Emoji1_24x24, false));

XamlSettings Settings = new XamlSettings();
Settings.TableCellRowBackgroundColor1 = "#20404040";
Settings.TableCellRowBackgroundColor2 = "#10808080";

string XAML = Markdown.GenerateXAML(Settings);
object UIElement = XamlReader.Parse(XAML);

Emojis are defined in Waher.Content.Emoji, and the set of free emojis from Emoji1 is made available in the Waher.Content.Emoji.Emoji1 project. The above code is taken from Waher.Client.WPF and is used to create chat sessions in a WPF client like the following:


The above chat session is made with a mock temperature devices defined in Waher.Mock.Temperature, which uses the Waher.Networking.XMPP.Chat project to create a sensor chat bot.