Skip to content

allow for inline ouput using additional pipe param#16

Open
larqitos wants to merge 1 commit intoconclurer:masterfrom
larqitos:master
Open

allow for inline ouput using additional pipe param#16
larqitos wants to merge 1 commit intoconclurer:masterfrom
larqitos:master

Conversation

@larqitos
Copy link

Added an additional arg so the user can use the inlineLexer to prevent the output of the p parameter. I'm new to the world of pipes but figured this might be the best way to do it.

So an example with the additional argument would be:
[innerHTML]="t.text || t.full_text | MarkdownToHtml:{}:true"

I'm adding this functionality because I am leveraging your functionality in one of my projects and could use it as well.

Comment on lines +9 to +11
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);
Copy link
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}"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants