Parsoid
A bidirectional parser between wikitext and HTML5
|
General token sanitizer. More...
Classes | |
class | AttributeExpander |
Generic attribute expansion handler. More... | |
class | AttributeTransformManager |
Utility transformation manager for expanding attributes whose keys and/or values are not plain strings. More... | |
class | BehaviorSwitchHandler |
Handler for behavior switches, like 'TOC' and similar. More... | |
class | DOMFragmentBuilder |
class | ExtensionHandler |
class | ExternalLinkHandler |
class | LanguageVariantHandler |
Handler for language conversion markup, which looks like -{ ... }- . More... | |
class | ListHandler |
Create list tag around list items and map wiki bullet levels to html. More... | |
class | OnlyInclude |
OnlyInclude sadly forces synchronous template processing, as it needs to hold onto all tokens in case an onlyinclude block is encountered later. More... | |
class | ParagraphWrapper |
Insert paragraph tags where needed – smartly and carefully – there is much fun to be had mimicking "wikitext visual newlines" behavior as implemented by the PHP parser. More... | |
class | ParserFunctions |
Some parser functions, and quite a bunch of stubs of parser functions. More... | |
class | PreHandler |
PRE-handling relies on the following 6-state FSM. More... | |
class | QuoteTransformer |
MediaWiki-compatible italic/bold handling as a token stream transformation. More... | |
class | SanitizerHandler |
class | TemplateEncapsulator |
A helper class for TemplateHandler that encapsulates template-like syntax with the appropriate meta tags, adding argument info data. More... | |
class | TemplateExpansionResult |
class | TemplateHandler |
Template and template argument handling. More... | |
class | TokenHandler |
class | TokenHandlerResult |
class | TokenStreamPatcher |
This class is an attempt to fixup the token stream to reparse strings as tokens that failed to parse in the tokenizer because of SOL or other constraints OR because tags were being constructed in pieces or whatever. More... | |
class | TraceProxy |
class | WikiLinkHandler |
Functions | |
array_flatten (array $array) | |
PORT-FIXME: Maybe we need to look at all uses of flatten and move it to a real helper in PHPUtils.js. | |
General token sanitizer.
Simple link handler.
Strips out (or encapsulates) unsafe and disallowed tag types and attributes. Should run last in the third, synchronous expansion stage.
FIXME: This code was originally ported from PHP to JS in 2012 and periodically updated before being back to PHP. This code should be (a) resynced with core sanitizer changes (b) updated to use HTML5 spec
TODO: keep round-trip information in meta tag or the like
Wikimedia\Parsoid\Wt2Html\TT\array_flatten | ( | array | $array | ) |
PORT-FIXME: Maybe we need to look at all uses of flatten and move it to a real helper in PHPUtils.js.
Flattens arrays with nested arrays
array | $array | array |