Class Markup
Makes paragraphs of text with the inline markup of Markdown: bold,
italic, bold italic, code and links, in the
fonts given for each, and as GitHub's Markdown has them, bold and
italic, strikethrough of two ~, one being text here, as in ~5, and
links that are their address,
<https://pdfjet.com> or https://pdfjet.com alone. An _ emphasizes
only at the edge of a word, so that snake_case is text; an address alone
ends before the punctuation at its end, as the period of a sentence, and
before a ) that closes no ( of its own. A backslash before a punctuation
character, as in *, makes it plain text, and so is a mark that has no
match, such as the * of 2 * 3. Emphasis can be inside a link, and neither
inside code. A word keeps its punctuation next to it in another style, as
in bold, with no space between them: the paragraph joins its text
lines with Paragraph.AddJoined.
Headings, lists, block quotes and the rest of Markdown's blocks are not read: a line break is a space, and Paragraphs splits a text into paragraphs at its empty lines. The markup is read in time linear in the length of the text, so it can come from anyone. Please see Example_18.
public class Markup
- Inheritance
-
Markup
- Inherited Members
Constructors
Markup(Font, Font, Font, Font, Font)
Creates the markup of paragraphs in the fonts, each at its size.
public Markup(Font regular, Font bold, Font italic, Font boldItalic, Font code)
Parameters
regularFontthe font of the text.
boldFontthe font of bold text.
italicFontthe font of italic text.
boldItalicFontthe font of bold italic text.
codeFontthe font of
code, usually a monospaced font.
Methods
Paragraph(string)
Returns the text as one paragraph: a text line for each run of text in one style, each joined to the text before it.
public Paragraph Paragraph(string text)
Parameters
textstringthe text with its markup.
Returns
- Paragraph
the paragraph.
Paragraphs(string)
Returns the paragraphs of the text, which empty lines separate.
public List<Paragraph> Paragraphs(string text)
Parameters
textstringthe text with its markup.
Returns
SetLinkColor(int)
Sets the color of the text of links. The default is Color.blue. Color.transparent leaves it unchanged.
public Markup SetLinkColor(int color)
Parameters
colorintthe color as a 0xRRGGBB value.
Returns
- Markup
this Markup.
SetLinkUnderline(bool)
Sets whether the text of links is underlined, as it is by default.
public Markup SetLinkUnderline(bool underline)
Parameters
underlinebooltrue to underline the links.
Returns
- Markup
this Markup.