Skip to content
Permalink
Browse files

Document potentially confusing split_metadata_from_text behavior

Signed-off-by: Chris Warrick <kwpolska@gmail.com>
  • Loading branch information
Kwpolska committed Jul 8, 2017
1 parent d482f68 commit 67b20ee839fcc39d8404dfc1e92008c6203962b9
Showing with 5 additions and 1 deletion.
  1. +5 −1 nikola/plugin_categories.py
@@ -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:

0 comments on commit 67b20ee

Please sign in to comment.
You can’t perform that action at this time.