seanbrant/pykss

remove the white space while substitute $modifier_class

Opened this issue · 0 comments

Thanks for the awesome package, I use the pace very often these days!

I meet a issue in my application that I must remove the extra space produced by Modifyer.add_example

class Modifier(object):

    def __init__(self, name, description):
        self.name = name
        self.description = description
        self.example = ''

    @property
    def class_name(self):
        return self.name.replace('.', ' ').replace(':', ' pseudo-class-').strip()

    def add_example(self, example):
        self.example = example.replace('$modifier_class', '  %s' % self.class_name)  #extra space here

can we just remove the first white space before %s?

my real case is a little complex to describe!