Skip to content

Commit

Permalink
Merge branch 'release-0.5.1'
Browse files Browse the repository at this point in the history
  • Loading branch information
haydenjackson01 committed Apr 24, 2017
2 parents 94b5e7b + 06f8a8e commit 78afb1d
Show file tree
Hide file tree
Showing 7 changed files with 81 additions and 9 deletions.
4 changes: 2 additions & 2 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ Verto allows for an author to quickly include images and content and display
them in a panel (similar to a Bootstrap Collapsible Panel) with the following
markdown:

.. code-block:: None
.. code-block::
# Example Header
Expand All @@ -37,7 +37,7 @@ output to stdout:
text = open('example.md', 'r')
converter = Verto()
result = converter.convert(text)
print(result.html_string)
Documentation
Expand Down
7 changes: 7 additions & 0 deletions docs/source/changelog.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
Changelog
#######################################

0.5.1
=======================================

Fixes:

- Verto tags and custom tags, are now support embedding into markdown lists.

0.5.0
=======================================

Expand Down
12 changes: 6 additions & 6 deletions verto/VertoExtension.py
Original file line number Diff line number Diff line change
Expand Up @@ -166,10 +166,10 @@ def buildProcessors(self, md, md_globals):
# Markdown overrides
['heading', HeadingBlockProcessor(self, md.parser), '<hashheader'],
# Single line (in increasing complexity)
['interactive', InteractiveBlockProcessor(self, md.parser), '_begin'],
['image', ImageBlockProcessor(self, md.parser), '_begin'],
['video', VideoBlockProcessor(self, md.parser), '_begin'],
['conditional', ConditionalProcessor(self, md.parser), '_begin'],
['interactive', InteractiveBlockProcessor(self, md.parser), '<paragraph'],
['image', ImageBlockProcessor(self, md.parser), '<paragraph'],
['video', VideoBlockProcessor(self, md.parser), '<paragraph'],
['conditional', ConditionalProcessor(self, md.parser), '<paragraph'],
# Multiline
]
self.inlinepatterns = [ # A special treeprocessor
Expand All @@ -194,10 +194,10 @@ def buildGenericProcessors(self, md, md_globals):
processor_class = processor_info.get('class', None)
if processor_class == 'generic_tag':
processor_object = GenericTagBlockProcessor(processor, self, md.parser)
self.blockprocessors.insert(0, [processor, processor_object, '_begin'])
self.blockprocessors.insert(0, [processor, processor_object, '<paragraph'])
if processor_class == 'generic_container':
processor_object = GenericContainerBlockProcessor(processor, self, md.parser)
self.blockprocessors.append([processor, processor_object, '_begin'])
self.blockprocessors.append([processor, processor_object, '<paragraph'])

def loadProcessorInfo(self):
'''Loads processor descriptions from a json file.
Expand Down
2 changes: 1 addition & 1 deletion verto/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# flake8: noqa
from .Verto import Verto

__version__ = '0.5.0'
__version__ = '0.5.1'
15 changes: 15 additions & 0 deletions verto/tests/ImageTest.py
Original file line number Diff line number Diff line change
Expand Up @@ -306,6 +306,21 @@ def test_align_undefined_error(self):

self.assertRaises(ArgumentValueError, lambda x: markdown.markdown(x, extensions=[self.verto_extension]), test_string)

def test_image_in_numbered_list(self):
'''Basic example of common usage.'''
test_string = self.read_test_file(self.processor_name, 'image_in_numbered_list.md')
blocks = self.to_blocks(test_string)

self.assertListEqual([False, False, False, True, False], [ImageBlockProcessor(self.ext, self.md.parser).test(blocks, block) for block in blocks], msg='"{}"'.format(test_string))

converted_test_string = markdown.markdown(test_string, extensions=[self.verto_extension])
expected_string = self.read_test_file(self.processor_name, 'image_in_numbered_list_expected.html', strip=True)
self.assertEqual(expected_string, converted_test_string)

images = self.verto_extension.required_files['images']
expected_images = set()
self.assertSetEqual(expected_images, images)

#~
# Doc Tests
#~
Expand Down
11 changes: 11 additions & 0 deletions verto/tests/assets/image/image_in_numbered_list.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
1. Lipsum

* Ichi
* Ni
* San

2. Lorem

{image file-path="http://placehold.it/350x150" caption="Placeholder image" source="https://placehold.it/" hover-text="This is hover text" alignment="left"}

3. Ipsem
39 changes: 39 additions & 0 deletions verto/tests/assets/image/image_in_numbered_list_expected.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
<ol>
<li>
<p>
Lipsum
</p>
<ul>
<li>
Ichi
</li>
<li>
Ni
</li>
<li>
San
</li>
</ul>
</li>
<li>
<p>
Lorem
</p>
<div>
<img class="left-align" src="http://placehold.it/350x150" title="This is hover text"/>
<p>
Placeholder image
</p>
<p>
<a href="https://placehold.it/">
Source
</a>
</p>
</div>
</li>
<li>
<p>
Ipsem
</p>
</li>
</ol>

0 comments on commit 78afb1d

Please sign in to comment.