@@ -597,12 +597,8 @@ private function getNextEmbedBlock(?int $indentation = null, bool $inSequence =
597
597
}
598
598
599
599
$ data = [];
600
- $ isInMultiLineQuote = false ;
601
600
602
601
if ($ this ->getCurrentLineIndentation () >= $ newIndent ) {
603
- if ($ this ->isCurrentLineMultiLineQuoteStart ()) {
604
- $ isInMultiLineQuote = true ;
605
- }
606
602
$ data [] = substr ($ this ->currentLine , $ newIndent ?? 0 );
607
603
} elseif ($ this ->isCurrentLineEmpty () || $ this ->isCurrentLineComment ()) {
608
604
$ data [] = $ this ->currentLine ;
@@ -639,16 +635,6 @@ private function getNextEmbedBlock(?int $indentation = null, bool $inSequence =
639
635
if ($ this ->isCurrentLineBlank ()) {
640
636
$ data [] = substr ($ this ->currentLine , $ newIndent );
641
637
continue ;
642
- } elseif (!$ isInMultiLineQuote && $ this ->isCurrentLineMultiLineQuoteStart ()) {
643
- $ isInMultiLineQuote = true ;
644
- $ data [] = substr ($ this ->currentLine , $ newIndent );
645
- continue ;
646
- } elseif ($ isInMultiLineQuote ) {
647
- $ data [] = $ this ->currentLine ;
648
- if ("' " === (rtrim ($ this ->currentLine )[-1 ] ?? '' )) {
649
- $ isInMultiLineQuote = false ;
650
- }
651
- continue ;
652
638
}
653
639
654
640
if ($ indent >= $ newIndent ) {
@@ -979,49 +965,6 @@ private function isCurrentLineLastLineInDocument(): bool
979
965
return ($ this ->offset + $ this ->currentLineNb ) >= ($ this ->totalNumberOfLines - 1 );
980
966
}
981
967
982
- /**
983
- * Returns true if the current line is the beginning of a multiline quoted block.
984
- */
985
- private function isCurrentLineMultiLineQuoteStart (): bool
986
- {
987
- $ trimmedLine = trim ($ this ->currentLine );
988
- $ trimmedLineLength = \strlen ($ trimmedLine );
989
- $ quoteCount = 0 ;
990
- $ value = '' ;
991
- // check if the key is quoted
992
- for ($ i = 0 ; $ i < $ trimmedLineLength ; ++$ i ) {
993
- $ char = $ trimmedLine [$ i ];
994
- if ("' " === $ char ) {
995
- ++$ quoteCount ;
996
- } elseif (': ' === $ char && 0 === $ quoteCount % 2 && ($ i === $ trimmedLineLength - 1 || ' ' === $ trimmedLine [$ i + 1 ])) {
997
- // key and value are separated by the first colon after the (quoted) key followed by a space or linebreak
998
- $ value = trim (substr ($ trimmedLine , ++$ i ), ' ' );
999
- break ;
1000
- }
1001
- }
1002
-
1003
- if (0 !== strpos ($ value , "' " )) {
1004
- return false ;
1005
- }
1006
-
1007
- $ lineEndQuoteCount = 0 ;
1008
- for ($ i = \strlen ($ value ) - 1 ; $ i > 0 ; --$ i ) {
1009
- $ char = $ value [$ i ];
1010
- if ("' " === $ char ) {
1011
- ++$ lineEndQuoteCount ;
1012
- } else {
1013
- break ;
1014
- }
1015
- }
1016
-
1017
- return 0 === $ lineEndQuoteCount % 2 ;
1018
- }
1019
-
1020
- /**
1021
- * Cleanups a YAML string to be parsed.
1022
- *
1023
- * @param string $value The input YAML string
1024
- */
1025
968
private function cleanup (string $ value ): string
1026
969
{
1027
970
$ value = str_replace (["\r\n" , "\r" ], "\n" , $ value );
0 commit comments