don't strip leading whitespace

This commit is contained in:
Damien Elmes 2012-02-29 12:51:00 +09:00
parent 099ba71bb0
commit 44dea8211e

View file

@ -70,11 +70,8 @@ class TextImporter(NoteImporter):
self.data = self.fileobj.read() self.data = self.fileobj.read()
if self.data.startswith(codecs.BOM_UTF8): if self.data.startswith(codecs.BOM_UTF8):
self.data = self.data[len(codecs.BOM_UTF8):] self.data = self.data[len(codecs.BOM_UTF8):]
print "fixme: don't strip leading whitespace"
def sub(s): def sub(s):
return re.sub( return re.sub("^\#.*", "", s)
"^\#.*", "", re.sub(
"^ +", "", s))
self.data = [sub(x) for x in self.data.split("\n") if sub(x)] self.data = [sub(x) for x in self.data.split("\n") if sub(x)]
if self.data: if self.data:
if self.data[0].startswith("tags:"): if self.data[0].startswith("tags:"):