public override void Process(TagHelperContext context, TagHelperOutput output) { output.TagName = "div"; string greenText = PostTextHelper.GetGreenText(Text); string textWithLinks = PostTextHelper.GeneratePostAnchorLinks(greenText); output.Content.SetHtmlContent(textWithLinks); }
public override void Process(TagHelperContext context, TagHelperOutput output) { string shortenedText = ""; if (Text.Length > 100) { shortenedText = Text.Substring(0, 100); if (shortenedText.Last() == ' ') { shortenedText.Remove(shortenedText.Last()); } shortenedText += "..."; } string textToDisplay = Text.Length > 100 ? shortenedText : Text; string greenText = PostTextHelper.GetGreenText(textToDisplay, true); output.Content.SetHtmlContent(greenText); }