Exemplo n.º 1
0
 def test_stomp_target(self):
     attrs = {
         (None, u'href'): u'http://example.com',
         (None, u'target'): u'foo'
     }
     assert (target_blank(attrs) == {
         (None, u'href'): 'http://example.com',
         (None, u'target'): u'_blank'
     })
Exemplo n.º 2
0
 def test_empty(self):
     attrs = {}
     assert target_blank(attrs) == attrs
Exemplo n.º 3
0
 def test_mailto(self):
     attrs = {(None, u'href'): u'mailto:[email protected]'}
     assert target_blank(attrs) == attrs
Exemplo n.º 4
0
 def test_mailto(self):
     attrs = {(None, u'href'): u'mailto:[email protected]'}
     assert target_blank(attrs) == attrs
Exemplo n.º 5
0
 def test_stomp_target(self):
     attrs = {(None, u'href'): u'http://example.com', (None, u'target'): u'foo'}
     assert (
         target_blank(attrs) ==
         {(None, u'href'): 'http://example.com', (None, u'target'): u'_blank'}
     )
Exemplo n.º 6
0
def target_blank_except_footnote(attrs, new=False):
    if "class" in attrs and attrs["class"] == "footnote-backref":
        return attrs
    else:
        return callbacks.target_blank(attrs, new)
Exemplo n.º 7
0
 def test_empty(self):
     attrs = {}
     assert target_blank(attrs) == attrs
Exemplo n.º 8
0
def target_blank_except_footnote(attrs, new=False):
    if "class" in attrs and \
       attrs["class"] in ("footnote-backref", "footnote-ref"):
        return attrs
    else:
        return callbacks.target_blank(attrs, new)
Exemplo n.º 9
0
 def test_add_target(self):
     attrs = {(None, 'href'): 'http://example.com'}
     assert (target_blank(attrs) == {
         (None, 'href'): 'http://example.com',
         (None, 'target'): '_blank'
     })
Exemplo n.º 10
0
 def test_stomp_target(self):
     attrs = {(None, "href"): "http://example.com", (None, "target"): "foo"}
     assert target_blank(attrs) == {
         (None, "href"): "http://example.com",
         (None, "target"): "_blank",
     }
Exemplo n.º 11
0
 def test_mailto(self):
     attrs = {(None, "href"): "mailto:[email protected]"}
     assert target_blank(attrs) == attrs
Exemplo n.º 12
0
 def test_add_target(self):
     attrs = {(None, 'href'): 'http://example.com'}
     assert (
         target_blank(attrs) ==
         {(None, 'href'): 'http://example.com', (None, 'target'): '_blank'}
     )