Commit graph

15 commits

Author SHA1 Message Date
Anntoin Wilkinson
be55a6de90 Add visit_html_block
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
2018-10-08 20:17:02 +01:00
Vasyl Fesik
a38bac33b7 rename CommonMark to commonmark in tests 2018-09-17 16:16:57 +03:00
djw
dd15581df1 Fix exception with link inside bold/italic
Return default line number of 0 when no sourcepos found.

Fixes #100
2018-05-07 17:24:07 +08:00
Kenneth Benzie (Benie)
7762ab3888 Fix hard error on cross-linking markdown document
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.
2017-11-02 16:46:27 +00:00
Anthony Johnson
e62f4039ea
Add missing inline code parsing 2017-03-23 14:13:47 -07:00
Anthony Johnson
8baf238562
Fix linking, add tests, fix auto toc, deprecate and remove auto ref
This fixes link nesting, and resolves some issues around links not closing
correctly. There were a few changes required to support the autotoc feature, and
the auto ref feature has be deprecated. This feature no longer is required, as
we are doing pending_xref natively. The functionality was breaking Sphinx
altogether, so it doesn't make sense to keep it and deprecate the feature.
2017-03-03 01:20:23 -08:00
Anthony Johnson
1f7f525c7b
Port in pending_xref node changes to references
* Moves changes from #61 into this PR
* Drops basic testing from #61
* Adds to implementation pending_xref back down to reference

The implementation in #61 breaks a number of cases, like "/example" and
"example.html", etc. Instead of trying to enumerate case we want an xref instead
of a pending_xref, just pin the xref on the pending_xref to back down.
pending_xref replaces itself with it's children if the reference isn't resolved.
2017-03-02 20:04:30 -08:00
Anthony Johnson
fe8e00ab41
Update to support CommonMark >= 0.7.3 and clean up code
This was already dealing with a rewrite due to the spec change on CommonMark, so
I took the opportunity to modernize the code and clean things up as well.

* Updates to support CommonMark==0.7.3
* Reworks pattern for handling CommonMark nodes, mimic docutils visit/depart
  pattern
* Drops SectionHandler class, as it was only used in one place. Merge into the
  parser class, where it is used
* Drops requirements file for setup.py config, as this is a package requirements
  is superfluous
* Adds a number of more detailed test cases
* Adds test runner for 3.5, 3.6
* Updates strictness on prospector, cleans up linting errors and docstring
  problems
2017-03-02 20:04:30 -08:00
Eric Holscher
50be4978d7 Merge pull request #61 from pfultz2/pending-xref
Use pending_xref for links
2017-03-02 14:25:43 -08:00
Paul
6a22f6b04b Add test for header nested in a block 2016-10-27 01:17:06 -05:00
Paul
ad36e4990c Add support for external links 2016-06-14 01:16:46 -05:00
Paul
c9c58bcfc9 Use pending_xref for reference nodes 2016-06-13 23:14:35 -05:00
Paul
0ff83a9091 Add tests for checking custom file extensions 2016-06-12 03:12:15 -05:00
Paul
0eee19e600 Add tests for checking that pygments will still highlight the code. This requires a newer version sphinx as well. 2016-06-10 21:08:31 -05:00
Eric Holscher
3c2cd4930d Add initial stab at testing & Travis/Tox integration 2015-10-19 11:41:10 -07:00