• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

Yoast / Yoast-SEO-for-TYPO3 / 21521134747

30 Jan 2026 03:30PM UTC coverage: 0.866% (-0.4%) from 1.275%
21521134747

push

github

RinyVT
[FEATURE] Version 12.0.0, added v14 support, removed v11 support including php8.0 and php8.1, rewrote backend javascript functionality to typescript and webcomponents

0 of 550 new or added lines in 53 files covered. (0.0%)

33 existing lines in 21 files now uncovered.

23 of 2657 relevant lines covered (0.87%)

0.03 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

0.0
/Classes/PageParser/BodyParser.php
1
<?php
2

3
/**
4
 * This file is part of the "yoast_seo" extension for TYPO3 CMS.
5
 *
6
 * For the full copyright and license information, please read the
7
 * LICENSE.txt file that was distributed with this source code.
8
 */
9

10
declare(strict_types=1);
11

12
namespace YoastSeoForTypo3\YoastSeo\PageParser;
13

14
use MaxServ\FrontendRequest\Dto\RequestContext;
15

16
class BodyParser extends \MaxServ\FrontendRequest\PageParser\Parser\BodyParser
17
{
18
    public function parse(string $html, RequestContext $context): string
19
    {
NEW
20
        $body = parent::parse($html, $context);
×
NEW
21
        preg_match_all(
×
NEW
22
            '/<!--\s*?TYPO3SEARCH_begin\s*?-->.*?<!--\s*?TYPO3SEARCH_end\s*?-->/mis',
×
NEW
23
            $body,
×
NEW
24
            $indexableContents
×
NEW
25
        );
×
26

NEW
27
        if (is_array($indexableContents[0]) && !empty($indexableContents[0])) {
×
NEW
28
            $body = implode('', $indexableContents[0]);
×
29
        }
30
        return $this->prepareBody($body);
×
31
    }
32

33
    protected function prepareBody(string $body): string
34
    {
35
        $body = $this->stripTagsContent($body, '<script><noscript>');
×
36
        $body = preg_replace(['/\s?\n\s?/', '/\s{2,}/'], [' ', ' '], $body);
×
37
        $body = strip_tags((string)$body, '<h1><h2><h3><h4><h5><p><a><img>');
×
38

39
        return trim($body);
×
40
    }
41

42
    protected function stripTagsContent(string $text, string $tags = ''): string
43
    {
44
        preg_match_all('/<(.+?)[\s]*\/?[\s]*>/si', trim($tags), $foundTags);
×
45
        $tagsArray = array_unique($foundTags[1]);
×
46

47
        if (count($tagsArray) > 0) {
×
48
            return (string)preg_replace('@<(' . implode('|', $tagsArray) . ')\b.*?>.*?</\1>@si', '', $text);
×
49
        }
50

51
        return $text;
×
52
    }
53
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc