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

Yoast / wordpress-seo / 481faf637ba3a7c1e5f2bfef59b582ac39523de6

21 May 2025 09:11AM UTC coverage: 46.174%. First build
481faf637ba3a7c1e5f2bfef59b582ac39523de6

Pull #22291

github

web-flow
Merge pull request #22278 from Yoast/577-sanitize-and-deal-with-special-markdown-characters-before-writing-to-file

577 sanitize and deal with special markdown characters before writing to file
Pull Request #22291: Introduce the llms.txt feature

52 of 403 new or added lines in 30 files covered. (12.9%)

15586 of 33755 relevant lines covered (46.17%)

3.67 hits per line

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

0.0
/src/llms-txt/domain/markdown/sections/description.php
1
<?php
2
// phpcs:disable Yoast.NamingConventions.NamespaceName.MaxExceeded
3
namespace Yoast\WP\SEO\Llms_Txt\Domain\Markdown\Sections;
4

5
use Yoast\WP\SEO\Llms_Txt\Application\Markdown_Escaper;
6
/**
7
 * Represents the description section.
8
 */
9
class Description implements Section_Interface {
10

11
        /**
12
         * The description.
13
         *
14
         * @var string
15
         */
16
        private $description;
17

18
        /**
19
         * Class constructor.
20
         *
21
         * @param string $description The description.
22
         */
NEW
23
        public function __construct( string $description ) {
×
NEW
24
                $this->description = $description;
×
25
        }
26

27
        /**
28
         * Returns the prefix of the description section.
29
         *
30
         * @return string
31
         */
NEW
32
        public function get_prefix(): string {
×
NEW
33
                return '> ';
×
34
        }
35

36
        /**
37
         * Renders the description section.
38
         *
39
         * @return string
40
         */
NEW
41
        public function render(): string {
×
NEW
42
                return $this->description;
×
43
        }
44

45
        /**
46
         * Escapes the markdown content.
47
         *
48
         * @param Markdown_Escaper $markdown_escaper The markdown escaper.
49
         *
50
         * @return void
51
         */
NEW
52
        public function escape_markdown( Markdown_Escaper $markdown_escaper ): void {
×
NEW
53
                $this->description = $markdown_escaper->escape_markdown_content( $this->description );
×
54
        }
55
}
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

© 2025 Coveralls, Inc