Skip to content

Commit

Permalink
Document potentially confusing split_metadata_from_text behavior
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 8, 2017
1 parent d482f68 commit 67b20ee
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion nikola/plugin_categories.py
Expand Up @@ -404,7 +404,11 @@ def _extract_metadata_from_text(self, source_text: str) -> dict:
raise NotImplementedError()

def split_metadata_from_text(self, source_text: str) -> (str, str):
"""Split text into metadata and content (both strings)."""
"""Split text into metadata and content (both strings).
If splitting fails (there is no match), return source_text as both metadata and content.
(This behavior is required for 2-file posts.)
"""
if self.split_metadata_re is None:
return source_text, source_text
else:
Expand Down

0 comments on commit 67b20ee

Please sign in to comment.