/Markdown-Tag

Render Markdown to HTML on any website using a md tag

Primary LanguageCSSGNU General Public License v3.0GPL-3.0

Markdown-Tag

The easiest way to add Markdown support to your website!
Show your support!

Example and usage

You can view a demo of Markdown Tag in use here.

How to use Markdown Tag:

Add support to any website to use markdown ANYWHERE with a simple tag! Like so -

        <md>
# Markdown Support
           
           Awesomeness
         </md>

include this script at the bottom of your HTML document.

<script src="https://cdn.jsdelivr.net/gh/MarketingPipeline/Markdown-Tag/markdown-tag.js"></script> 

How to use Markdown Tag with GitHub Styling:

Instead of using a <md> tag use

     <github-md># Example </github-md>

How to render new text or a new Markdown Tag added to HTML:

Call this function using a onclick etc..

renderMarkdown();

Syntax

This script uses Showdown to render Markdown - to read about the Showdown's Markdown syntax style click here

How to use CommonMark Syntax:

If you wish to use CommonMark syntax instead of Showdown's use this script instead of the one above at the bottom of your HTML document.

<script src="https://cdn.jsdelivr.net/gh/MarketingPipeline/Markdown-Tag/markdown-tag-commonmark.js"></script> 

How to use GitHub Flavored Markdown Syntax:

If you wish to use GitHub Flavored Markdown Spec syntax use this script instead of the other script's above at the bottom of your HTML document.

   <script src="https://cdn.jsdelivr.net/gh/MarketingPipeline/Markdown-Tag/markdown-tag-GitHub.js"></script> 

Note: This options includes - Tables, GitHub Mentions & More.

Syntax Highlighting

Note: to use Syntax Hightlighting - you must use the GitHub flavored version of Markdown Tag.

By default using a <github-md> will automatically add a CSS stylesheet for GitHub like syntax hightlighting colors.

To use Syntax Highlighting with a <md> tag, you will need to apply a CSS stylesheet. You can find a list of Syntax Hightlighting Stylesheets that work with Markdown Tag here

Handling untrusted content

By default Markdown-Tag does not santize the Markdown you provide, since in most use cases the content is trusted.

Any other content provided from user's on your website etc. Should be santized before adding it inside a <md> or <github-md> tag to prevent XSS.

Contributing GitHub

Want to improve this? Create a pull request with detailed changes / improvements! If approved you will be added to the list of contributors of this awesome project!

Looking for a task to work on? Check the tasks that need improved in the to-do list.

See also the list of contributors who participate in this project.

License GitHub

This project is licensed under the GPL-3.0 License - see the LICENSE.md file for details.