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

Breadcrumb

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

function HTML::printTextBlock

Print a text block found in a standard.

Parameters

\DOMNode $node The DOMNode object for the text block.:

Return value

void

1 call to HTML::printTextBlock()
HTML::processSniff in vendor/squizlabs/php_codesniffer/src/Generators/HTML.php
Process the documentation for a single sniff.

File

vendor/squizlabs/php_codesniffer/src/Generators/HTML.php, line 226

Class

HTML

Namespace

PHP_CodeSniffer\Generators

Code

protected function printTextBlock(DOMNode $node) {
    $content = trim($node->nodeValue);
    $content = htmlspecialchars($content);
    // Use the correct line endings based on the OS.
    $content = str_replace("\n", PHP_EOL, $content);
    // Allow em tags only.
    $content = str_replace('&lt;em&gt;', '<em>', $content);
    $content = str_replace('&lt;/em&gt;', '</em>', $content);
    echo "  <p class=\"text\">{$content}</p>" . PHP_EOL;
}

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal