tags: TagLine constructor now supports multiline taglines and multiple spaces
This commit is contained in:
@@ -102,10 +102,12 @@ class TagLine(str):
|
||||
|
||||
def __new__(cls: Type[TagLineInst], string: str) -> TagLineInst:
|
||||
"""
|
||||
Make sure the tagline string starts with the prefix.
|
||||
Make sure the tagline string starts with the prefix. Also replace newlines
|
||||
and multiple spaces with ' ', in order to support multiline TagLines.
|
||||
"""
|
||||
if not string.startswith(cls.prefix):
|
||||
raise TagError(f"TagLine '{string}' is missing prefix '{cls.prefix}'")
|
||||
string = ' '.join(string.split())
|
||||
instance = super().__new__(cls, string)
|
||||
return instance
|
||||
|
||||
|
||||
Reference in New Issue
Block a user