mirror of
https://github.com/ankitects/anki.git
synced 2025-09-24 16:56:36 -04:00
don't strip leading whitespace
This commit is contained in:
parent
099ba71bb0
commit
44dea8211e
1 changed files with 1 additions and 4 deletions
|
@ -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:"):
|
||||||
|
|
Loading…
Reference in a new issue