Skip to content

Commit

Permalink
Slightly smarter return values for split_metadata_for_text
Browse files Browse the repository at this point in the history
Signed-off-by: Chris Warrick <kwpolska@gmail.com>
  • Loading branch information
Kwpolska committed Jul 7, 2017
1 parent 2e05f03 commit f8d1814
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions nikola/plugin_categories.py
Expand Up @@ -410,10 +410,9 @@ def split_metadata_from_text(self, source_text: str) -> (str, str):
else:
split_result = self.split_metadata_re.split(source_text.lstrip(), maxsplit=1)
if len(split_result) == 1:
return split_result[0], split_result[0]
return source_text, source_text
else:
# Necessary?
return split_result[0], split_result[-1]
return split_result

def extract_text(self, source_text: str) -> dict:
"""Extract metadata from text (also calls ``split_metadata_from_text``)."""
Expand Down

0 comments on commit f8d1814

Please sign in to comment.