File tree Expand file tree Collapse file tree 3 files changed +43
-1
lines changed
src/Markdown/Parsers/InlineParsers
tests/Integration/tests/markdown/paragraph-md/input Expand file tree Collapse file tree 3 files changed +43
-1
lines changed Original file line number Diff line number Diff line change 11
11
use phpDocumentor \Guides \Markdown \Parsers \InlineParsers \InlineCodeParser ;
12
12
use phpDocumentor \Guides \Markdown \Parsers \InlineParsers \InlineImageParser ;
13
13
use phpDocumentor \Guides \Markdown \Parsers \InlineParsers \LinkParser ;
14
+ use phpDocumentor \Guides \Markdown \Parsers \InlineParsers \NewLineParser ;
14
15
use phpDocumentor \Guides \Markdown \Parsers \InlineParsers \PlainTextParser ;
15
16
use phpDocumentor \Guides \Markdown \Parsers \InlineParsers \StrongParser ;
16
17
use phpDocumentor \Guides \Markdown \Parsers \ListBlockParser ;
73
74
->set (InlineImageParser::class)
74
75
->arg ('$inlineParsers ' , tagged_iterator ('phpdoc.guides.markdown.parser.inlineParser ' ))
75
76
->tag ('phpdoc.guides.markdown.parser.inlineParser ' )
77
+ ->set (NewLineParser::class)
78
+ ->tag ('phpdoc.guides.markdown.parser.inlineParser ' )
76
79
77
80
->set (MarkupLanguageParser::class)
78
81
->arg ('$parsers ' , tagged_iterator ('phpdoc.guides.markdown.parser.blockParser ' ))
Original file line number Diff line number Diff line change
1
+ <?php
2
+
3
+ declare (strict_types=1 );
4
+
5
+ /**
6
+ * This file is part of phpDocumentor.
7
+ *
8
+ * For the full copyright and license information, please view the LICENSE
9
+ * file that was distributed with this source code.
10
+ *
11
+ * @link https://phpdoc.org
12
+ */
13
+
14
+ namespace phpDocumentor \Guides \Markdown \Parsers \InlineParsers ;
15
+
16
+ use League \CommonMark \Node \Inline \Newline ;
17
+ use League \CommonMark \Node \Node as CommonMarkNode ;
18
+ use League \CommonMark \Node \NodeWalker ;
19
+ use League \CommonMark \Node \NodeWalkerEvent ;
20
+ use phpDocumentor \Guides \MarkupLanguageParser ;
21
+ use phpDocumentor \Guides \Nodes \Inline \InlineNode ;
22
+ use phpDocumentor \Guides \Nodes \Inline \PlainTextInlineNode ;
23
+
24
+ /** @extends AbstractInlineParser<PlainTextInlineNode> */
25
+ class NewLineParser extends AbstractInlineParser
26
+ {
27
+ public function __construct ()
28
+ {
29
+ }
30
+
31
+ public function parse (MarkupLanguageParser $ parser , NodeWalker $ walker , CommonMarkNode $ current ): InlineNode
32
+ {
33
+ return new PlainTextInlineNode (' ' );
34
+ }
35
+
36
+ public function supports (NodeWalkerEvent $ event ): bool
37
+ {
38
+ return $ event ->isEntering () && $ event ->getNode () instanceof Newline;
39
+ }
40
+ }
Load Diff This file was deleted.
You can’t perform that action at this time.
0 commit comments