Netcarver\Textile\Parser
Textile parser.
Synopsis
class Parser
{
- // members
- protected string $ver = '3.5.2';
- protected $regex_snippets;
- protected string $hlgn = "(?:\<(?!>)|<>|>|<|(?<!<)\>|\<\>|\=|[()]+(?! ))";
- protected string $vlgn = "[\-^~]";
- protected string $clas = "(?:\([^)\n]+\))";
- protected string $lnge = "(?:\[[^]\n]+\])";
- protected string $styl = "(?:\{[^}\n]+\})";
- protected string $cspn = "(?:\\\\\d+)";
- protected string $rspn = "(?:\/\d+)";
- protected $a;
- protected $s;
- protected $c;
- protected $lc;
- protected array $blocktag_whitelist = ;
- protected string $pnct = '[\!"#\$%&\'()\*\+,\-\./:;<=>\?@\[\\\]\^_`{\|}\~]';
- protected $urlch;
- protected string $syms = '¤§µ¶†‡•∗∴◊♠♣♥♦';
- protected $rel;
- protected $fn;
- protected array $shelf = ;
- protected bool $restricted = false;
- protected bool $noimage = false;
- protected bool $lite = false;
- protected array $url_schemes = ;
- protected array $restricted_url_schemes = ;
- protected array $unrestricted_url_schemes = ;
- protected array $span_tags = ;
- protected null|array $glyph_search = NULL;
- protected null|array $glyph_replace = NULL;
- protected bool $rebuild_glyphs = true;
- protected string $relativeImagePrefix = '';
- protected integer $max_span_depth = 5;
- protected $doc_root;
- protected $doctype;
- protected array $symbols = ;
- protected bool $dimensionless_images = false;
- protected string $ds = '/';
- protected bool $mb;
- protected array $cmap = ;
- protected integer $note_index = 1;
- protected array $unreferencedNotes = ;
- protected array $notelist_cache = ;
- protected array $notes = ;
- protected array $urlrefs = ;
- protected integer $span_depth = 0;
- protected $uid;
- protected integer $refIndex = 1;
- protected array $refCache = ;
- // methods
- public void __construct()
- public setSymbol()
- public array|string getSymbol()
- public Parser setRelativeImagePrefix()
- public Parser setDimensionlessImages()
- public bool getDimensionlessImages()
- public string getVersion()
- public string textileEncode()
- public string textileThis()
- public string textileRestricted()
- protected string textileCommon()
- protected void prepGlyphs()
- protected void prepare()
- protected string cleanAttribs()
- protected Tag newTag()
- protected string parseAttribs()
- protected array parseAttribsToArray()
- protected bool hasRawText()
- protected string tables()
- protected string fTable()
- protected string redclothLists()
- protected string fRedclothList()
- protected string textileLists()
- protected string fTextileList()
- protected string liType()
- protected string doTagBr()
- protected string doPBr()
- protected string fPBr()
- protected string fBr()
- protected string blocks()
- protected array fBlock()
- protected string formatFootnote()
- protected string replaceMarkers()
- protected string getHTMLComments()
- protected string fParseHTMLComments()
- protected string graf()
- protected string spans()
- protected string fSpan()
- protected array storeTags()
- protected string retrieveTags()
- protected string fRetrieveTags()
- protected string placeNoteLists()
- protected string fNoteLists()
- protected string makeBackrefLink()
- protected string fParseNoteDefs()
- protected string noteRefs()
- protected string fParseNoteRefs()
- protected bool parseURI()
- protected bool addPart()
- protected string rebuildURI()
- protected string links()
- protected string fLink()
- protected string getRefs()
- protected string refs()
- protected string shelveURL()
- protected string retrieveURLs()
- protected string retrieveURL()
- protected string relURL()
- protected bool isRelURL()
- protected string images()
- protected string fImage()
- protected string code()
- protected string fCode()
- protected string fPre()
- protected string shelve()
- protected string retrieve()
- protected string cleanWhiteSpace()
- protected string doSpecial()
- protected string fSpecial()
- protected string noTextile()
- protected string fTextile()
- protected string footnoteRefs()
- protected string footnoteID()
- protected string glyphs()
- protected string replaceGlyphs()
- protected string hAlign()
- protected string vAlign()
- protected string encodeHigh()
- protected string decodeHigh()
- protected string encodeHTML()
- protected string rEncodeHTML()
Members
protected
- $a
—
string
? - $blocktag_whitelist
—
array
Whitelisted block tags. - $c
—
string
Pattern that matches a class, style, language and horisontal alignment attributes. - $clas
—
string
Pattern for HTML classes and IDs. - $cmap
—
array
Multi-byte conversion map. - $cspn
—
string
? - $dimensionless_images
—
Netcarver\Textile\bool
Dimensionless images flag. - $doc_root
—
string
Server document root. - $doctype
—
string
Target document type. - $ds
—
string
Directory separator. - $fn
—
array
Array of footnotes - $glyph_replace
—
Netcarver\Textile\null|array
Glyph replacements. - $glyph_search
—
Netcarver\Textile\null|array
Patterns for finding glyphs. - $hlgn
—
string
Pattern for horizontal align. - $lc
—
string
Pattern that matches class, style and language attributes. - $lite
—
Netcarver\Textile\bool
Lite mode. - $lnge
—
string
Pattern for language attribute. - $max_span_depth
—
int
Maximum nesting level for inline elements. - $mb
—
Netcarver\Textile\bool
Whether mbstring extension is installed. - $noimage
—
Netcarver\Textile\bool
Disallow images. - $note_index
—
int
Stores note index. - $notelist_cache
—
array
Stores note lists. - $notes
—
array
Stores notes. - $pnct
—
string
Pattern for punctation. - $rebuild_glyphs
—
Netcarver\Textile\bool
Indicates whether glyph substitution is required. - $refCache
—
array
Stores references values. - $refIndex
—
int
Token reference index. - $regex_snippets
—
array
Regular expression snippets. - $rel
—
string
HTML rel attribute used for links. - $relativeImagePrefix
—
string
Relative image path. - $restricted
—
Netcarver\Textile\bool
Restricted mode. - $restricted_url_schemes
—
array
Restricted link protocols. - $rspn
—
string
? - $s
—
string
? - $shelf
—
array
Shelved content. - $span_depth
—
int
Stores span depth. - $styl
—
string
Pattern for style attribute. - $symbols
—
array
Substitution symbols. - $syms
—
string
Matched marker symbols. - $uid
—
string
Unique ID used for reference tokens. - $unreferencedNotes
—
array
Stores unreferenced notes. - $unrestricted_url_schemes
—
array
Unrestricted link protocols. - $url_schemes
—
array
Accepted link protocols. - $urlch
—
string
Pattern for URL. - $urlrefs
—
array
Stores URL references. - $ver
—
string
Version number. - $vlgn
—
string
Pattern for vertical align.
Methods
protected
- addPart() — Checks whether a component part can be added to a URI.
- blocks() — Splits the given input into blocks.
- cleanAttribs() — Cleans a HTML attribute value.
- cleanWhiteSpace() — Removes BOM and unifies line ending in the given input.
- code() — Parses code blocks in the given input.
- decodeHigh() — Converts numeric HTML character references to character code.
- doPBr() — Adds br tags to paragraphs and headings.
- doSpecial() — Uses the specified callback method to format the content between end and start nodes.
- doTagBr() — Adds br tags within the specified container tag.
- encodeHTML() — Convert special characters to HTML entities.
- encodeHigh() — Converts character codes in the given input from HTML numeric character reference to character code.
- fBlock() — Formats the given block.
- fBr() — Formats line breaks.
- fCode() — Formats inline code tags.
- fImage() — Formats an image and stores it on the shelf.
- fLink() — Formats a link and stores it on the shelf.
- fNoteLists() — Formats a note list.
- fPBr() — Less restrictive version of fBr method.
- fParseHTMLComments() — Formats a HTML comment.
- fParseNoteDefs() — Formats note definitions.
- fParseNoteRefs() — Formats note reference links.
- fPre() — Formats pre tags.
- fRedclothList() — Constructs a HTML definition list from a RedCloth-style definition structure.
- fRetrieveTags() — Retrieves a tag from the tag cache.
- fSpan() — Formats a span tag and stores it on the shelf.
- fSpecial() — Formats blocks that should display HTML as text.
- fTable() — Constructs a HTML table from a textile table structure.
- fTextile() — Format notextile blocks.
- fTextileList() — Constructs a HTML list from a textile list structure.
- footnoteID() — Renders a footnote reference link or ID.
- footnoteRefs() — Parses footnote reference links in the given input.
- formatFootnote() — Formats a footnote.
- getHTMLComments() — Parses HTML comments in the given input.
- getRefs() — Finds URI aliases within the given input.
- glyphs() — Replaces glyphs in the given input.
- graf() — Parses paragraphs in the given input.
- hAlign() — Translates alignment tag into corresponding CSS text-align property value.
- hasRawText() — Checks whether the text is not enclosed by a block tag.
- images() — Parses and shelves images in the given input.
- isRelURL() — Checks if an URL is relative.
- liType() — Determines the list type from the textile input symbol.
- links() — Parses and shelves links in the given input.
- makeBackrefLink() — Renders a note back reference link.
- newTag() — Constructs a HTML tag from an object.
- noTextile() — Parses notextile tags in the given input.
- noteRefs() — Parses note references in the given input.
- parseAttribs() — Parses Textile attributes.
- parseAttribsToArray() — Parses Textile attributes into an array.
- parseURI() — Parses URI into component parts.
- placeNoteLists() — Parses note lists in the given input.
- prepGlyphs() — Prepares the glyph patterns from the symbol table.
- prepare() — Prepares the parser for parsing.
- rEncodeHTML() — Convert special characters to HTML entities.
- rebuildURI() — Rebuild a URI from parsed parts and a mask.
- redclothLists() — Parses RedCloth-style definition lists into HTML.
- refs() — Parses, encodes and shelves the current URI alias.
- relURL() — Completes and formats a URL.
- replaceGlyphs() — Replaces glyph references in the given input.
- replaceMarkers() — Replaces markers with replacements in the given input.
- retrieve() — Replaces reference tokens with corresponding shelved content.
- retrieveTags() — Replaces reference tokens with corresponding shelved span tags.
- retrieveURL() — Retrieves an URL from the shelve.
- retrieveURLs() — Replaces reference tokens with corresponding shelved URL.
- shelve() — Shelves parsed content.
- shelveURL() — Shelves parsed URLs.
- spans() — Replaces Textile span tags with their equivalent HTML inline tags.
- storeTags() — Stores a tag pair in the tag cache.
- tables() — Parses textile table structures into HTML.
- textileCommon() — Parses Textile syntax.
- textileLists() — Parses textile list structures into HTML.
- vAlign() — Translates vertical alignment tag into corresponding CSS vertical-align property value.
public
- __construct() — Constructor.
- getDimensionlessImages() — Whether images will get dimensions or not.
- getSymbol() — Gets a symbol definitions.
- getVersion() — Gets Textile version number.
- setDimensionlessImages() — Toggles image dimension attributes.
- setRelativeImagePrefix() — Sets base image directory path.
- setSymbol() — Defines a substitution symbol.
- textileEncode() — Encodes the given text.
- textileRestricted() — Parses the given Textile input in restricted mode.
- textileThis() — Parses the given Textile input in un-restricted mode.