A bit of a brute force solution, but the parser splits the attribute
upon encountering a quote into multiple nodes. Walk through them,
collect strings and drop them from further parsing.
The current RecommonMark specification on images [0] says that:

should render as
<p><img src="/url" alt="foo" title="title" /></p>
which means that "foo" should be the `alt` attribute, and "title" should
be the `title` attribute.
Currently, `recommonmark` will:
1. set the `alt` attribute to "title"
2. render "foo" as literal text following the image element.
Neither yields results in line with the RecommonMark standard, resulting
in the following when transformed to HTML:
<p><img src="/url" alt="title" />foo</p>
While it might be surprising that `alt` is set to "title", the more
pressing issue is how the alt text becomes literal text within the
paragraph, typically not rendering well.
This commit instead makes `recommonmark`:
1. set the `alt` attribute to "foo"
2. drop "title" altogether since the `title` attribute is not supported
in Docutils [1].
1 coincides with the specification, and 2 is in my mind the least
surprising solution within the capabilities of Docutils. The HTML will
now be:
<p><img src="/url" alt="foo" /></p>
only differing in the missing `title` attribute when compared to the
specification.
[0]: https://spec.commonmark.org/0.28/#images
[1]: http://docutils.sourceforge.net/docs/ref/rst/directives.html#image
In #118, there was a change made to rename all commonmark imports from `commonmark` to `CommonMark` due to a breaking change to the package name in that dependency in version 0.8.1. However, the dependency on `commonmark` wasn't updated, which means that people pulling in commonmark >= 0.7.3 and < 0.8.1 are experiencing issues while using recommonmark. This updates the versioned dependency accordingly to resolve this issue.
Without this any html_block nodes processed by the parser are dropped.
`visit_html_block` uses the existing logic for `visit_html_inline`.
Added a test case to check html_blocks are parsed as expected.
Fixes: https://github.com/rtfd/recommonmark/issues/121
Clearly there have been many changes since 0.4.0. I propose the next release be 0.5.0. In the meantime, by adding a [development release separator](https://www.python.org/dev/peps/pep-0440/#development-release-separators) pip will more clearly indicate the package version for those installing via git.
Add a description, URL and license to `setup.py` so [the recommonmark package page on PyPI](https://pypi.org/project/recommonmark/) will include that information.
When section name is not written in ASCII, the ID of the section will be
generated by default, in the form of 'id<unique number>'. This is no good
writing links to other document, whose ID are subject to change in adding
or removing sections.
Adding a `translate_section_name` filter in Parser will allow user to install
a customized one to translate the section name into more readable one. For
example, convert the Chinese section name to more ASCII-friendly pinyin.
Sphinx 1.6.5 with tip recommonmark hard errors when a markdown document
contains a cross-reference to another local markdown document as it
unconditionally access the `refdomain` of a `pending_xref`. This was
fixed [elsewhere](https://github.com/ignatenkobrain/sphinxcontrib-issuetracker/pull/13/files#diff-61beda6e59ec3020dbf0c2826dbb64c4R161)
by setting it to `None`. This patch uses the same approach which no
longer causes the Sphinx build to fail on cross-linking a markdown
document however the generated link is not correctly rendered producing
broken links in the generated html.
Addressing the broken links, the `mdnode.destination` is stripped of its
file extension if that extension is supported by `CommonMarkParser`
however this will only work for markdown documents, not ReStructuedText
or any other extended file type parsers.
Fixes#89.