Skip to content

Angular 2 Pipe that transforms a markdown string to HTML

License

Notifications You must be signed in to change notification settings

conclurer/markdown-to-html-pipe

Folders and files

NameName
Last commit message
Last commit date

Latest commit

977f5cd · Dec 13, 2018

History

36 Commits
Nov 14, 2016
Aug 18, 2016
Nov 14, 2016
Nov 14, 2016
Dec 13, 2018
Aug 17, 2016
Dec 13, 2018
Aug 17, 2016
Sep 6, 2017
Oct 20, 2016
Dec 13, 2018
Dec 13, 2018
Aug 18, 2016

Repository files navigation

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