sync with GH

git-svn-id: svn://svn.icms.temple.edu/lammps-ro/trunk@15746 f3b2605a-c512-4ea7-a41b-209d697bcdaa
This commit is contained in:
sjplimp
2016-10-11 18:43:51 +00:00
parent 7a4da54a71
commit e710053de6
14 changed files with 205 additions and 130 deletions

View File

@ -104,7 +104,7 @@ class RSTMarkup(Markup):
anchor_pos = href.find('#')
if anchor_pos >= 0:
if anchor_pos >= 0 and not href.startswith('http'):
href = href[anchor_pos+1:]
return ":ref:`%s <%s>`" % (content, href)

View File

@ -424,6 +424,11 @@ class TestSpecialCommands(unittest.TestCase):
"one \n\n"
"a :ref:`link <name>` to above\n\n", s)
def test_external_anchor_link(self):
s = self.txt2rst.convert('some text "containing a\n'
'link"_http://lammps.sandia.gov/movies.html#granregion with an anchor')
self.assertEqual('some text `containing a link <http://lammps.sandia.gov/movies.html#granregion>`_ with an anchor\n\n', s)
def test_define_link_alias(self):
s = self.txt2rst.convert("one :link(alias,value)\n"
"\"test\"_alias\n")