ParagraphNode.cs 443 B

12345678910111213141516171819202122232425262728
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Text;
  4. namespace Larkdown.Parser.Ast
  5. {
  6. public class ParagraphNode : Node
  7. {
  8. public string Text { get; private set; }
  9. public ParagraphNode()
  10. : base(nameof(ParagraphNode))
  11. {
  12. Text = String.Empty;
  13. }
  14. public ParagraphNode AddText(string text)
  15. {
  16. Text += text;
  17. return this;
  18. }
  19. public bool IsEmpty()
  20. {
  21. return String.IsNullOrEmpty(Text);
  22. }
  23. }
  24. }