diff options
author | pommicket <pommicket@gmail.com> | 2025-09-23 11:05:20 -0400 |
---|---|---|
committer | pommicket <pommicket@gmail.com> | 2025-09-23 11:05:20 -0400 |
commit | 7afac3b1f9fb29bb6e68f5ebe8782488b6be4d98 (patch) | |
tree | 7616b9228f5a1742fc92d5c7e1726c7c0bd55ea8 /pom_parser/__init__.py | |
parent | 4226ee008894e03ed9e3d2e77f3ae3c536e4509e (diff) |
Start tests, fix some bugs
Diffstat (limited to 'pom_parser/__init__.py')
-rw-r--r-- | pom_parser/__init__.py | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/pom_parser/__init__.py b/pom_parser/__init__.py index 4604a78..35d0f49 100644 --- a/pom_parser/__init__.py +++ b/pom_parser/__init__.py @@ -437,6 +437,9 @@ class _Parser: except UnicodeDecodeError: self._error('Bad UTF-8') return '' + if self.line_number == 1 and line.startswith('\ufeff'): + # skip byte order mark + line = line[1:] if line.endswith('\r\n'): line = line[:-2] elif line.endswith('\n'): @@ -496,6 +499,8 @@ class _Parser: value = line[equals_idx+1:].lstrip(' \t') if value.startswith('"') or value.startswith('`'): value = self._parse_quoted_value(value) + else: + value = value.rstrip(' \t') key = f'{self.current_section}.{relative_key}' if self.current_section else relative_key item = Item() item.key = key |