mirror of
https://github.com/avatao-content/frontend-tutorial-framework
synced 2025-01-16 12:51:55 +00:00
15 lines
301 B
TypeScript
15 lines
301 B
TypeScript
|
import { Injectable } from '@angular/core';
|
||
|
import { Converter } from 'showdown';
|
||
|
|
||
|
@Injectable()
|
||
|
export class MarkdownService {
|
||
|
private converter: Converter;
|
||
|
constructor() {
|
||
|
this.converter = new Converter();
|
||
|
}
|
||
|
|
||
|
convertToHtml(text: string) {
|
||
|
return this.converter.makeHtml(text);
|
||
|
}
|
||
|
}
|