git @ Cat's Eye Technologies Feedmark / ab6ae94
Make sure this works with @-list properties. Chris Pressey 6 years ago
3 changed file(s) with 13 addition(s) and 6 deletion(s). Raw diff Collapse all Expand all
33 * url: http://example.com/refllama.xml
44 * link-target-url: https://github.com/catseye/Feedmark/blob/master/eg/Referenced%20Llama%20Sightings.md
55 * hopper: [Stephen](https://en.wikipedia.org/wiki/Stephen_Hopper)
6 * llama: has been [spotted][]
6 * spotted @ [the mall][]
7 * spotted @ [the beach](beach.html)
78
89 Some **llamas** have been [spotted][] recently.
910
1112
1213 * date: Nov 1 2016 09:00:00
1314 * hopper: [Grace](https://en.wikipedia.org/wiki/Grace_Hopper)
14 * llama: it's been [spotted][]
15 * spotted @ [the mall][]
16 * spotted @ [the lumberyard](lumberyard.html)
1517
1618 I have strong opinions about this. It's a _shame_ more llamas aren't
1719 being spotted. Sometimes they are **striped**, it's true, but
2426 Sight them, sigh.
2527
2628 [spotted]: spotted.html
29 [the mall]: mall.html
2730 [site]: https://en.wikipedia.org/wiki/Site
2525 if obj is None:
2626 return None
2727 elif isinstance(obj, dict):
28 return dict((k, remove_outer_p(markdown_to_html5_deep(v, **kwargs))) for k, v in obj.items())
28 return dict((k, markdown_to_html5_deep(v, **kwargs)) for k, v in obj.items())
2929 elif isinstance(obj, list):
3030 return [markdown_to_html5_deep(subobj, **kwargs) for subobj in obj]
3131 else:
32 return markdown_to_html5(unicode(obj), **kwargs)
32 return remove_outer_p(markdown_to_html5(unicode(obj), **kwargs))
3333
3434
3535 def markdownize_properties(properties, property_priority_order):
131131 data['documents'][0]['properties']['hopper'],
132132 '<a href="https://en.wikipedia.org/wiki/Stephen_Hopper">Stephen</a>'
133133 )
134 self.assertEqual(data['documents'][0]['properties']['llama'], 'has been <a href="spotted.html">spotted</a>')
134 self.assertEqual(
135 data['documents'][0]['properties']['spotted'],
136 [u'<a href="mall.html">the mall</a>', u'<a href="beach.html">the beach</a>']
137 )
135138 self.assertEqual(
136139 data['documents'][0]['sections'][0]['properties']['hopper'],
137140 '<a href="https://en.wikipedia.org/wiki/Grace_Hopper">Grace</a>'
138141 )
139142 self.assertEqual(
140 data['documents'][0]['sections'][0]['properties']['llama'], "it's been <a href=\"spotted.html\">spotted</a>"
143 data['documents'][0]['sections'][0]['properties']['spotted'],
144 [u'<a href="mall.html">the mall</a>', u'<a href="lumberyard.html">the lumberyard</a>']
141145 )
142146
143147 def test_output_refdex(self):