summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lps_gen.py9
-rw-r--r--tests/files/lp-speakers.md6
-rw-r--r--tests/test_lps_gen.py26
3 files changed, 18 insertions, 23 deletions
diff --git a/lps_gen.py b/lps_gen.py
index 4abc79b..2322960 100644
--- a/lps_gen.py
+++ b/lps_gen.py
@@ -176,12 +176,14 @@ class LPSpeakersRenderer(Renderer):
lpspeakers_dict[self.speaker_type][-1]['speaker'] = text
lpspeakers_dict[self.speaker_type][-1]['id'] = self.mk_uid(text)
+ lpspeakers_dict[self.speaker_type][-1]['bio'] = []
elif level == 2:
self.speaker_type = 'speakers'
lpspeakers_dict[self.speaker_type].append(OrderedDict())
lpspeakers_dict[self.speaker_type][-1]['speaker'] = text.split(', ')[0]
lpspeakers_dict[self.speaker_type][-1]['id'] = self.mk_uid(text)
+ lpspeakers_dict[self.speaker_type][-1]['bio'] = []
return super(LPSpeakersRenderer, self).header(text, level, raw)
@@ -200,12 +202,11 @@ class LPSpeakersRenderer(Renderer):
p = super(LPSpeakersRenderer, self).paragraph(text)
- if not lpspeakers_dict[self.speaker_type][-1].has_key('bio'):
- lpspeakers_dict[self.speaker_type][-1]['bio'] = []
+ if text.startswith('<img'):
+ # ignore
return p
- lpspeakers_dict[self.speaker_type][-1]['bio'].append(p)
-
+ lpspeakers_dict[self.speaker_type][-1]['bio'].append(text)
return p
diff --git a/tests/files/lp-speakers.md b/tests/files/lp-speakers.md
index 74cdbbb..fed771a 100644
--- a/tests/files/lp-speakers.md
+++ b/tests/files/lp-speakers.md
@@ -55,8 +55,6 @@ system.
# Ludovic Courtès
-NO_IMAGE
-
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec a diam
lectus. Sed sit amet ipsum mauris. Maecenas congue ligula ac quam
viverra nec consectetur ante hendrerit. Donec et mollis
@@ -98,8 +96,6 @@ issues.
## Richard Fontana, Red Hat
-NO_IMAGE
-
Richard Fontana is a lawyer at Red Hat. He leads support for Red Hat's
engineering and research and development units and is Red Hat's lead
counsel for legal issues relating to free software. Richard is also a
@@ -133,8 +129,6 @@ years, in France and now in Canada.
## M. C. McGrath
-NO_IMAGE
-
M. C. is the founder of Transparency Toolkit, a free software project
that helps people use open data to expose surveillance and human
rights abuses. He is also a Thiel Fellow and an Echoing Green
diff --git a/tests/test_lps_gen.py b/tests/test_lps_gen.py
index f9510dc..96695c4 100644
--- a/tests/test_lps_gen.py
+++ b/tests/test_lps_gen.py
@@ -298,14 +298,14 @@ class TestLPSpeakers(object):
"""
- keynote_speaker_bios = [['<p>Daniel Kahn Gillmor is a technologist with the ACLU\'s Speech, Privacy'],
- ['<p>Edward Snowden is a former intelligence officer who served the CIA,'],
- ['<p>Richard is a software developer and software freedom activist. In 1983',
- '<p>Since the mid-1990s, Richard has spent most of his time in political',],
+ keynote_speaker_bios = [['Daniel Kahn Gillmor is a technologist with the ACLU\'s Speech, Privacy'],
+ ['Edward Snowden is a former intelligence officer who served the CIA,'],
+ ['Richard is a software developer and software freedom activist. In 1983',
+ 'Since the mid-1990s, Richard has spent most of his time in political',],
[],
- ['<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec a diam',
- '<p>Ut turpis felis, pulvinar a semper sed, adipiscing id']]
+ ['Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec a diam',
+ 'Ut turpis felis, pulvinar a semper sed, adipiscing id']]
i = 0
@@ -409,16 +409,16 @@ class TestLPSpeakers(object):
"""Testing LPSpeakersMarkdown speakers' bio.
"""
- speaker_bios = [['<p>Emmanuel is a Division III student at Hampshire College, studying how'],
+ speaker_bios = [['Emmanuel is a Division III student at Hampshire College, studying how'],
[],
- ['<p>Marianne Corvellec has been a Free Software activist with April'],
- ['<p>Richard Fontana is a lawyer at Red Hat. He leads support for Red Hat\'s'],
+ ['Marianne Corvellec has been a Free Software activist with April'],
+ ['Richard Fontana is a lawyer at Red Hat. He leads support for Red Hat\'s'],
[],
- ['<p>Bassam is a 3D animator/filmmaker whose 2006 short, Elephants Dream,'],
- ['<p>Jonathan has been involved with the Free Software Movement for ten'],
- ['<p>M. C. is the founder of Transparency Toolkit, a free software project'],
+ ['Bassam is a 3D animator/filmmaker whose 2006 short, Elephants Dream,'],
+ ['Jonathan has been involved with the Free Software Movement for ten'],
+ ['M. C. is the founder of Transparency Toolkit, a free software project'],
[],
- ['<p>Stefano Zacchiroli is Associate Professor of Computer Science at']]
+ ['Stefano Zacchiroli is Associate Professor of Computer Science at']]
i = 0
for kspeaker in self.lpspeakers_dict['speakers']: