Provides text-only or limited-HTML extracts of page HTML.
More...
|
| __construct ( $text, $plainText) |
|
| filterContent () |
| Removes content we've chosen to remove then removes class and style attributes from the remaining span elements.
|
|
| getText ( $element=null) |
| Performs final transformations (such as newline replacement for plaintext option) and returns resulting HTML.
|
|
| onHtmlReady ( $html) |
|
Provides text-only or limited-HTML extracts of page HTML.
- Note
- GPL-2.0-or-later
Definition at line 13 of file ExtractFormatter.php.
◆ __construct()
TextExtracts\ExtractFormatter::__construct |
( |
| $text, |
|
|
| $plainText ) |
- Parameters
-
string | $text | Text to convert |
bool | $plainText | Whether extract should be plaintext |
Definition at line 26 of file ExtractFormatter.php.
◆ filterContent()
TextExtracts\ExtractFormatter::filterContent |
( |
| ) |
|
Removes content we've chosen to remove then removes class and style attributes from the remaining span elements.
- Returns
- array Array of removed DOMElements
Definition at line 82 of file ExtractFormatter.php.
◆ getText()
TextExtracts\ExtractFormatter::getText |
( |
| $element = null | ) |
|
Performs final transformations (such as newline replacement for plaintext option) and returns resulting HTML.
- Parameters
-
DOMElement | string | null | $element | ID of element to get HTML from. Ignored |
- Returns
- string Processed HTML
Definition at line 47 of file ExtractFormatter.php.
◆ onHtmlReady()
TextExtracts\ExtractFormatter::onHtmlReady |
( |
| $html | ) |
|
- Parameters
-
string | $html | HTML string to process |
- Returns
- string Processed HTML
Definition at line 66 of file ExtractFormatter.php.
◆ $plainText
bool TextExtracts\ExtractFormatter::$plainText |
|
private |
◆ SECTION_MARKER_END
const TextExtracts\ExtractFormatter::SECTION_MARKER_END = "\2\1" |
◆ SECTION_MARKER_START
const TextExtracts\ExtractFormatter::SECTION_MARKER_START = "\1\2" |
The documentation for this class was generated from the following file: