From a490027e0c4c8cf70774382b586e3e66d7e7b274 Mon Sep 17 00:00:00 2001 From: Eduardo Pedroni Date: Thu, 23 Feb 2017 10:16:59 +0100 Subject: Fixed bug where last card was not loaded, multiple line breaks between cards are no longer printed --- flashcards | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'flashcards') diff --git a/flashcards b/flashcards index 1cbcfc6..0b57dbe 100755 --- a/flashcards +++ b/flashcards @@ -38,11 +38,13 @@ def extractCards(f): match = re.match(cardRegex, l) if match: if front != "": - cards.append([front, back]) + cards.append([front.strip(), back.strip()]) back = "" front = match.string[prefixLength:] else: back += l + # do the last front-back pair before returning + cards.append([front.strip(), back.strip()]) return cards # Loops serving cards to the user until the program is exited -- cgit v1.2.3