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

dg / texy / 22262589061

21 Feb 2026 07:04PM UTC coverage: 92.991% (+1.8%) from 91.178%
22262589061

push

github

dg
LinkModule: deprecated label and modifiers in link definitions

3 of 3 new or added lines in 1 file covered. (100.0%)

126 existing lines in 22 files now uncovered.

2083 of 2240 relevant lines covered (92.99%)

0.93 hits per line

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

96.43
/src/Texy/Modules/BlockQuoteModule.php
1
<?php declare(strict_types=1);
2

3
/**
4
 * This file is part of the Texy! (https://texy.nette.org)
5
 * Copyright (c) 2004 David Grudl (https://davidgrudl.com)
6
 */
7

8
namespace Texy\Modules;
9

10
use Texy;
11
use function max, strlen;
12

13

14
/**
15
 * Processes blockquote syntax with nested content.
16
 */
17
final class BlockQuoteModule extends Texy\Module
18
{
19
        public function __construct(
1✔
20
                private Texy\Texy $texy,
21
        ) {
22
        }
1✔
23

24

25
        public function beforeParse(string &$text): void
1✔
26
        {
27
                $this->texy->registerBlockPattern(
1✔
28
                        $this->parse(...),
1✔
29
                        '~^
30
                                (?: ' . Texy\Patterns::MODIFIER_H . '\n)? # modifier (1)
1✔
31
                                >                                      # blockquote char
32
                                ( [ \t]++ | : )                        # space/tab or colon (2)
33
                                ( \S.*+ )                              # content (3)
34
                        $~mU',
35
                        'blockquote',
1✔
36
                );
37
        }
1✔
38

39

40
        /**
41
         * Parses blockquote.
42
         * @param  array<?string>  $matches
43
         */
44
        public function parse(Texy\BlockParser $parser, array $matches): ?Texy\HtmlElement
1✔
45
        {
46
                [, $mMod, $mPrefix, $mContent] = $matches;
1✔
47
                // [1] => .(title)[class]{style}<>
48
                // [2] => spaces |
49
                // [3] => ... / LINK
50

51
                $texy = $this->texy;
1✔
52

53
                $el = new Texy\HtmlElement('blockquote');
1✔
54
                $mod = Texy\Modifier::parse($mMod);
1✔
55
                $mod->decorate($texy, $el);
1✔
56

57
                $content = '';
1✔
58
                $spaces = '';
1✔
59
                do {
60
                        if ($spaces === '') {
1✔
61
                                $spaces = max(1, strlen($mPrefix));
1✔
62
                        }
63
                        $content .= $mContent . "\n";
1✔
64

65
                        if (!$parser->next("~^>(?: | ([ \\t]{1,$spaces} | :) (.*))$~mA", $matches)) {
1✔
66
                                break;
1✔
67
                        }
68

69
                        [, $mPrefix, $mContent] = $matches;
1✔
70
                } while (true);
1✔
71

72
                $el->parseBlock($texy, $content, $parser->isIndented());
1✔
73

74
                // no content?
75
                if (!$el->count()) {
1✔
UNCOV
76
                        return null;
×
77
                }
78

79
                // event listener
80
                $texy->invokeHandlers('afterBlockquote', [$parser, $el, $mod]);
1✔
81

82
                return $el;
1✔
83
        }
84
}
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