Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

allow for inline ouput using additional pipe param #16

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

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