Skip to content
Permalink
Browse files

Fix #1539

  • Loading branch information
ralsina committed Jan 13, 2015
1 parent ea17d14 commit c9c7a97002427a531f73f71ab7d6b5ac223c9d23
Showing with 7 additions and 0 deletions.
  1. +1 −0 CHANGES.txt
  2. +6 −0 nikola/post.py
@@ -32,6 +32,7 @@ Features
Bugfixes
--------

* Handle over-and-under-lined titles in rst fr guessing title (Issue #1539)
* Respect SHOW_UNTRANSLATED_POSTS = False in archives
and for untranslated source files (Issue #1360)
* Make sure drafts don’t appear in sitemaps with multiple languages
@@ -700,6 +700,8 @@ def _get_metadata_from_file(meta_data):
>>> g = _get_metadata_from_file
>>> list(g([]).values())
[]
>>> str(g(["======","FooBar","======"])["title"])
'FooBar'
>>> str(g(["FooBar","======"])["title"])
'FooBar'
>>> str(g(["#FooBar"])["title"])
@@ -734,6 +736,10 @@ def _get_metadata_from_file(meta_data):
if 'title' not in meta:
if re_rst_title.findall(line) and i > 0:
meta['title'] = meta_data[i - 1].strip()
if 'title' not in meta:
if (re_rst_title.findall(line) and i >= 0 and
re_rst_title.findall(meta_data[i + 2])):
meta['title'] = meta_data[i + 1].strip()
if 'title' not in meta:
if re_md_title.findall(line):
meta['title'] = re_md_title.findall(line)[0]

0 comments on commit c9c7a97

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