File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -328,6 +328,10 @@ fn find_key_colon(content: &str) -> Option<usize> {
328328 while i < bytes. len ( ) {
329329 match bytes[ i] {
330330 b'\'' => {
331+ // YAML '' escape (literal single quote) is handled correctly here:
332+ // the first ' closes, the second immediately reopens, producing
333+ // the same result as explicit escape handling since '' is the
334+ // only escape sequence in single-quoted YAML strings.
331335 i += 1 ;
332336 while i < bytes. len ( ) && bytes[ i] != b'\'' {
333337 i += 1 ;
@@ -375,6 +379,8 @@ fn extract_inline_comment(line: &str) -> Option<&str> {
375379 while i < bytes. len ( ) {
376380 match bytes[ i] {
377381 b'\'' if !in_double_quote => {
382+ // YAML '' escape: two toggles (true→false→true) is a no-op,
383+ // which is correct since '' is the only escape in single-quoted strings.
378384 in_single_quote = !in_single_quote;
379385 }
380386 b'"' if !in_single_quote => {
You can’t perform that action at this time.
0 commit comments