angular-markdown-text

An easy to use markdown directive with static outlining, html escaping/sanitization, resource loading and model binding.
1 person uses it
Author: 2729829?v=2 McNull
Submitted by: 2729829?v=2 McNull

angular-markdown-text

An easy to use markdown directive with static outlining, html escaping/sanitization, resource loading and model binding.

Demo

A demonstration can be found here.

Dependencies

Installation

Either copy the contents of the dist folder found on GitHub or install with Bower.

Installation of angular-sanitize is recommended but optional; the module will detect if it's available.

Usage

The markdown directive can work with static content, model binding and external resources.

Static Content

The simplest form is wrapping the markdown directive around your text. The directive will automatically outline the content so that you don't have to worry about spaces or tabs in your html markup.

Model Binding

Provide the markdown-model attribute a model expression to convert its value to html.

External Resources

The directive allows you to load markdown files from a server by specifying a url expression in the markdown-src attribute. Note that, like the ng-include attribute, this is an expression; static values should be surrounded by a single quote (').

Other Attributes

These attributes are simply overrides of the configuration. If no value (true/false) is provided the default found in the markdownConfig is used.

markdown-escape-html - escape any html content.

markdown-sanitize - sanitize the html output.

markdown-outline - outline the markup.

Configuration

Global configuration can be modified by injecting the markdownConfig at the config phase of your module.

Configuration Properties

comments powered by Disqus
This page was last updated over 2 years ago.