Skip to main content

Convert discord messages to HTML

Project description

Discord Markdown

I needed to render some Discord chat logs as HTML, and found that the Markdown implementation in Discord isn't quite compliant with Common Markdown as Discord uses a simplified version.

So I wrote this library that allows you to convert a discord message written in the Markdown formatting syntax specified here to html.

Installation

You can install the library from pypi:

pip install discord-markdown

Usage

from discord_markdown.discord_markdown import convert_to_html

text = "_This_ **is** an __example__.\nThis should be a different paragraph."
html = convert_to_html(text)

assert html == '<p><i>This</i> <b>is</b> an <u>example</u>.</p><p>This should be a different paragraph.</p>'

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

discord_markdown-0.4.0.tar.gz (4.8 kB view hashes)

Uploaded source

Built Distribution

discord_markdown-0.4.0-py3-none-any.whl (6.1 kB view hashes)

Uploaded py3

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Huawei Huawei PSF Sponsor Microsoft Microsoft PSF Sponsor NVIDIA NVIDIA PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page