From dfbd8c2f1096e15d70ce44e54a4915f7a75f26e1 Mon Sep 17 00:00:00 2001 From: Julio Biason Date: Mon, 15 Apr 2019 09:44:24 -0300 Subject: [PATCH] Fixed the title detection --- makeidx.py | 8 ++++++-- porque-rust.html | 2 +- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/makeidx.py b/makeidx.py index 4e351a8..62d4d0f 100644 --- a/makeidx.py +++ b/makeidx.py @@ -11,7 +11,8 @@ import datetime import json DATA_BACKGROUND = re.compile(r"data-background=['\"](.*?)['\"]") -PRES_TITLE = re.compile(r"(.*?)") +PRES_TITLE1 = re.compile(r"(.*?)") +PRES_TITLE2 = re.compile(r"(.*?)") HEADER = re.compile(r"section.*data-background=['\"]" r"(?P.*?)['\"].*data-header" r"(?P.*?)section", re.M | re.S) @@ -33,7 +34,10 @@ def retrieve_presentation_info(filename): logging.debug('Header: %r', header.groupdict()) image = header.groupdict()['image'] - title = PRES_TITLE.search(header.groupdict()['content']) + title = PRES_TITLE1.search(header.groupdict()['content']) + + if not title: + title = PRES_TITLE2.search(header.groupdict()['content']) if content and image and title: logging.debug('Image for %s = %s', filename, image) diff --git a/porque-rust.html b/porque-rust.html index 47acd44..b9aed52 100644 --- a/porque-rust.html +++ b/porque-rust.html @@ -74,7 +74,7 @@
-

Porque Rust

+

Porque VocĂȘ Deveria Aprender Rust