Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. Tokenizer.php

function Tokenizer::characterData

Parse anything that looks like character data.

Different rules apply based on the current text mode.

See also

Elements::TEXT_RAW Elements::TEXT_RCDATA.

1 call to Tokenizer::characterData()
Tokenizer::consumeData in vendor/masterminds/html5/src/HTML5/Parser/Tokenizer.php
Consume a character and make a move. HTML5 8.2.4.1.

File

vendor/masterminds/html5/src/HTML5/Parser/Tokenizer.php, line 197

Class

Tokenizer
The HTML5 tokenizer.

Namespace

Masterminds\HTML5\Parser

Code

protected function characterData() {
    $tok = $this->scanner
        ->current();
    if (false === $tok) {
        return false;
    }
    switch ($this->textMode) {
        case Elements::TEXT_RAW:
            return $this->rawText($tok);
        case Elements::TEXT_RCDATA:
            return $this->rcdata($tok);
        default:
            if ('<' === $tok || '&' === $tok) {
                return false;
            }
            return $this->text($tok);
    }
}
RSS feed
Powered by Drupal