GH_Parser

public class GH_Parser
Provides parsing methods for the Grasshopper Markdown flavour.

Properties

Whitespace

#
public static char[] Whitespace { get; }
Gets an array of characters that are considered to be whitespace. At the moment, this array contains the space char and the tab char, it does not contain feeds or breaks.

Methods

IsChapterHeaderLine

#
public static bool IsChapterHeaderLine(string line)
Test whether a line represents a chapter header underline. Chapter header underlines contain at least 4 consecutive equals symbols preceded or followed by any amount of white space.
line (string)Line to test.
True if the line is considered to be a chapter header underline.

IsCommentLine

#
public static bool IsCommentLine(string line)
Test whether a line is a comment. Commented lines begin with double slashes (//) and are ignored during parsing.
line (string)Line to test. If you supply a multi-line string, death's too good for you.
True if the line is a comment line.

IsLinkLine

#
public static bool IsLinkLine(string line, ref string linkId, ref string linkTarget, ref string linkTooltip)
Test whether a line represents a referenced link target.
line (string)Line to test.
linkId (ref string)
linkTarget (ref string)
linkTooltip (ref string)
True if the line is a referenced link.

IsLinkLine

#
public static bool IsLinkLine(string line)
Test whether a line represents a referenced link target. Note; this is a quick check. The link might still be invalid, use the IsLinkLine overload to include validity checks.
line (string)Line to test.
True if the line is a referenced link.

IsListLine

#
public static bool IsListLine(string line)
Test whether a line contains a list item.
line (string)Line to check.
True if the line contains a list item.

IsParagraphHeaderLine

#
public static bool IsParagraphHeaderLine(string line)
Test whether a line represents a paragraph header underline. Paragraph header underlines contain at least 4 consecutive dashes preceded or followed by any amount of white space.
line (string)Line to test.
True if the line is considered to be a paragraph header underline.

IsQuoteLine

#
public static bool IsQuoteLine(string line)
Test whether a line is a block quote line. Block quotes start with a larger than symbol.
line (string)Line to test.
True if the line is a block quote.

StringToFragment

#
public static IGH_Content StringToFragment(string text)
Parse a block of text and return it as an interpreted IGH_Fragment.
text (string)Text to parse.
Fragment representing the text.