Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/markdown-to-html.pipe.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ import * as marked from 'marked';
})

export class MarkdownToHtmlPipe implements PipeTransform {
public transform(markdown: string, options?: MarkedOptions): string {
public transform(markdown: string, options?: MarkedOptions, inline?: boolean): string {
if (markdown == null) return '';
return marked(markdown, options);
return (inline) ? marked.inlineLexer(markdown, [], options) : marked(markdown, options);
Comment on lines +9 to +11
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for your contribution!
Could you wrap inline into an object?

It think { inline: true } is much more expressive
[innerHTML]="t.text || t.full_text | MarkdownToHtml:{}:{inline: true}"

}

public static setOptions(options: MarkedOptions): void {
Expand Down