yisraelx / ngx-showdown

Angular (>=2) integration for Showdown
http://yisraelx.github.io/ngx-showdown
MIT License
15 stars 13 forks source link

doesn't support strikethrough #13

Closed rcogal closed 5 years ago

rcogal commented 5 years ago

Hi,

format: ~~ Scratch this. ~~ output: Scratch this

tried the format above but it doesn't scratch the text.

yisraelx commented 5 years ago

In the default showdown options, the strikethrough option is set to false , so you must set strikethrough to true in order for it to work.

import { Component, NgModule } from '@angular/core';
import { ShowdownModule } from 'ngx-showdown';

@Component({
  selector: 'app',
  template: '<showdown>~~ Scratch this. ~~</showdown>'
})
export class AppComponent {}

@NgModule({
  declarations: [ AppComponent ],
  imports: [ ShowdownModule.forRoot({ strikethrough: true }) ]
})
export class AppModule {}

Or in the template

<showdown strikethrough>~~ Scratch this. ~~</showdown>

You can see strikethrough working in the demo.

rcogal commented 5 years ago

this resolves the problem. thank you, @yisraelx