mirror of
https://github.com/ryanoasis/nerd-fonts.git
synced 2024-12-19 20:12:52 +02:00
name-parser: Fix SIL replacements
[why] If the font name is changed in a way where it now ends in a blank (for example because 'Name Momo' got 'Momo' dropped: 'Name '), that blank is not removed immediately. Well, it is later on, but anyhow. This can only happen on malformed SIL entries. But we want to have a correct replacement anyhow. [how] Remove trailing whitespace after replacements. Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
This commit is contained in:
parent
1da85df08b
commit
848ed2500a
@ -88,7 +88,7 @@ class FontnameParser:
|
|||||||
continue
|
continue
|
||||||
i = len(self.basename) - len(m.group(0))
|
i = len(self.basename) - len(m.group(0))
|
||||||
if i < 0:
|
if i < 0:
|
||||||
self.basename = m.expand(replacement)
|
self.basename = m.expand(replacement).rstrip()
|
||||||
self.rest = self.rest[-(i+1):].lstrip()
|
self.rest = self.rest[-(i+1):].lstrip()
|
||||||
else:
|
else:
|
||||||
self.basename = m.expand(replacement) + self.basename[len(m.group(0)):]
|
self.basename = m.expand(replacement) + self.basename[len(m.group(0)):]
|
||||||
|
Loading…
Reference in New Issue
Block a user