Parsoid
A bidirectional parser between wikitext and HTML5
|
Public Member Functions | |
getFlag (int $flag) | |
Check whether a bit is set in $this->bits. | |
setFlag (int $flag, bool $value=true) | |
Set a bit in $this->bits. | |
setTagData (string $key, $data) | |
Set a tag attribute for a specific extension with a given key. | |
getTagData (string $key) | |
Get a tag attribute for a specific extension tag with a given key. | |
Public Attributes | |
const | IS_NEW = 1 << 0 |
Whether a DOM node is a new node added during an edit session. | |
const | NO_ATTRS = 1 << 1 |
The tokenizer sets this on table cells originating in wikitext-style syntax with no attributes set in the input. | |
const | NON_MERGEABLE_TABLE_CELL = 1 << 2 |
The tokenizer sets this on table cells that use "||" or "!!" style syntax for th/td cells. | |
const | FAILED_REPARSE = 1 << 3 |
This is set on cell elements that could not be combined with the previous cell. | |
const | WRAPPER = 1 << 4 |
This is set on span tags that are created by PipelineUtils::addSpanWrappers(). | |
const | SET_DSR = 1 << 5 |
This is set on wrapper tokens created by PipelineUtils::encapsulateExpansionHTML() to propagate the setDSR option to that function. | |
const | FROM_CACHE = 1 << 6 |
This is set on wrapper tokens created by PipelineUtils::encapsulateExpansionHTML() to propagate the fromCache option to that function. | |
const | LINTED = 1 << 7 |
A flag private to Linter, used to suppress duplicate messages. | |
const | PROCESSED_TIDY_WS_BUG = 1 << 8 |
A flag private to Linter to help it traverse a DOM. | |
const | IN_TRANSCLUSION = 1 << 9 |
This is set on all elements that originate in a template. | |
const | FROM_FOSTER = 1 << 10 |
MarkFosteredContent sets this on meta mw:Transclusion tags. | |
const | BOGUS_PX = 1 << 11 |
Used to indicate that media dimensions have redundant units. | |
int | $tagId |
All elements inserted by TreeBuilderStage receive an integer ID. | |
int | $bits = 0 |
A combination of flags combined from consts on this class. | |
Wikimedia\Parsoid\NodeData\TempData::getTagData | ( | string | $key | ) |
Get a tag attribute for a specific extension tag with a given key.
string | $key | identifier to support a map for multiple tags |
Wikimedia\Parsoid\NodeData\TempData::setTagData | ( | string | $key, |
$data ) |
Set a tag attribute for a specific extension with a given key.
string | $key | identifier to support a map for multiple extensions |
mixed | $data |
int Wikimedia\Parsoid\NodeData\TempData::$tagId |
All elements inserted by TreeBuilderStage receive an integer ID.
It is used in findAutoInsertedTags() in conjunction with data-stag to identify auto-inserted tags, and for debugging.
const Wikimedia\Parsoid\NodeData\TempData::FAILED_REPARSE = 1 << 3 |
This is set on cell elements that could not be combined with the previous cell.
Private to TableFixups.
const Wikimedia\Parsoid\NodeData\TempData::FROM_FOSTER = 1 << 10 |
MarkFosteredContent sets this on meta mw:Transclusion tags.
It is only used in an assertion.
const Wikimedia\Parsoid\NodeData\TempData::IN_TRANSCLUSION = 1 << 9 |
This is set on all elements that originate in a template.
It controls the insertion of mw:Transclusion markers in MarkFosteredContent.
const Wikimedia\Parsoid\NodeData\TempData::IS_NEW = 1 << 0 |
Whether a DOM node is a new node added during an edit session.
figureHandler() sets this on synthetic div elements.
const Wikimedia\Parsoid\NodeData\TempData::NON_MERGEABLE_TABLE_CELL = 1 << 2 |
The tokenizer sets this on table cells that use "||" or "!!" style syntax for th/td cells.
While the tokenizer sets this on all cells, we are only interested in this info for td/th cells in "SOF" context (modulo comments & whtespace) in templates. Since Parsoid processes templates in independent parsing contexts, td/dh cells with this flag set cannot be merged with preceding cells. But cells without this flag and coming from a template are viable candidates for merging.