@@ -388,6 +388,56 @@ public function testHybridParserSkipsEscapedTags()
388388 }
389389 }
390390
391+ /**
392+ * @dataProvider provideRunsOfOpeningTags
393+ */
394+ #[DataProvider('provideRunsOfOpeningTags ' )]
395+ public function testParsersFindTagsInsideRunsOfOpeningTags (ParserInterface $ parser , $ code , array $ expected )
396+ {
397+ $ this ->assertShortcodes ($ parser ->parse ($ code ), $ expected );
398+ }
399+
400+ public static function provideRunsOfOpeningTags ()
401+ {
402+ $ double = new Syntax ('[[ ' , ']] ' , '// ' , '== ' , '"" ' );
403+ $ curly = new Syntax ('{{ ' , '}} ' , '/ ' , '= ' , '" ' );
404+ $ cases = array (
405+ array ($ double , '[[[a]] ' , array (
406+ new ParsedShortcode (new Shortcode ('a ' , array (), null , null ), '[[a]] ' , 1 ),
407+ )),
408+ array ($ double , '[[a]][[[b]] ' , array (
409+ new ParsedShortcode (new Shortcode ('a ' , array (), null , null ), '[[a]] ' , 0 ),
410+ new ParsedShortcode (new Shortcode ('b ' , array (), null , null ), '[[b]] ' , 6 ),
411+ )),
412+ array ($ double , '[[a]]x[[[//a]] ' , array (
413+ new ParsedShortcode (new Shortcode ('a ' , array (), 'x[ ' , null ), '[[a]]x[[[//a]] ' , 0 ),
414+ )),
415+ array ($ double , '[[[[a]] ' , array (
416+ new ParsedShortcode (new Shortcode ('a ' , array (), null , null ), '[[a]] ' , 2 ),
417+ )),
418+ array ($ curly , 'a{{{x}} ' , array (
419+ new ParsedShortcode (new Shortcode ('x ' , array (), null , null ), '{{x}} ' , 2 ),
420+ )),
421+ array ($ curly , '{{x}}{{{/x}} ' , array (
422+ new ParsedShortcode (new Shortcode ('x ' , array (), '{ ' , null ), '{{x}}{{{/x}} ' , 0 ),
423+ )),
424+ array ($ curly , '{{a k="{{"}} ' , array (
425+ new ParsedShortcode (new Shortcode ('a ' , array ('k ' => '{{ ' ), null , null ), '{{a k="{{"}} ' , 0 ),
426+ )),
427+ array (new Syntax ('«« ' , '»» ' , '/ ' , '= ' , '" ' ), 'ż«««x»» ' , array (
428+ new ParsedShortcode (new Shortcode ('x ' , array (), null , null ), '««x»» ' , 2 ),
429+ )),
430+ );
431+
432+ $ result = array ();
433+ foreach ($ cases as $ case ) {
434+ $ result [] = array (new RegularParser ($ case [0 ]), $ case [1 ], $ case [2 ]);
435+ $ result [] = array (new HybridParser ($ case [0 ]), $ case [1 ], $ case [2 ]);
436+ }
437+
438+ return $ result ;
439+ }
440+
391441 public function testIssue119 ()
392442 {
393443 $ cases = array (
0 commit comments