Ticket #219: pyyaml-ticket-219.patch

File pyyaml-ticket-219.patch, 1.1 KB (added by py4fun@…, 2 years ago)

Fix issue 219

  • tests/data/tab-in-scalar.data

     
     1L       S 
  • tests/data/tab-in-scalar.canonical

     
     1%YAML 1.1 
     2--- 
     3"L\tS" 
  • lib/yaml/scanner.py

     
    13221322 
    13231323    def scan_plain_spaces(self, indent, start_mark): 
    13241324        # See the specification for details. 
    1325         # The specification is really confusing about tabs in plain scalars. 
    1326         # We just forbid them completely. Do not use tabs in YAML! 
    13271325        chunks = [] 
    13281326        length = 0 
    1329         while self.peek(length) in u' ': 
     1327        while self.peek(length) in u' \t': 
    13301328            length += 1 
    13311329        whitespaces = self.prefix(length) 
    13321330        self.forward(length)