markdown-to-html-pipe

Angular Pipe that transforms a markdown string to HTML


Keywords
angular2, markdown, pipe, html, angular2-pipe
License
MIT
Install
npm install markdown-to-html-pipe@1.2.5

Documentation

Markdown To HTML Pipe

Converts a Markdown string, outputs HTML.

Usage

// example.module.ts
import {NgModule} from '@angular/core';
import {MarkdownToHtmlModule} from 'markdown-to-html-pipe';
import {ExampleComponent} from './example.component';

@NgModule({
  imports: [MarkdownToHtmlModule],
  declarations: [ExampleComponent]
})
export class ExampleModule {}
// example.component.ts
import {Component} from '@angular/core';

@Component({
  selector: 'example',
  template: `<div [innerHTML]="content|MarkdownToHtml"></div>`
})
export class ExampleComponent {
  protected content: string = 'This will render **Markdown** content!';
}

Will be rendered as:

<div>
  <p>This will render <strong>Markdown</strong> content!</p>
</div>

Installation

Run

npm install --save markdown-to-html-pipe