Пример #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'
     })
Пример #2
0
 def test_empty(self):
     attrs = {}
     assert target_blank(attrs) == attrs
Пример #3
0
 def test_mailto(self):
     attrs = {(None, u'href'): u'mailto:[email protected]'}
     assert target_blank(attrs) == attrs
Пример #4
0
 def test_mailto(self):
     attrs = {(None, u'href'): u'mailto:[email protected]'}
     assert target_blank(attrs) == attrs
Пример #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'}
     )
Пример #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)
Пример #7
0
 def test_empty(self):
     attrs = {}
     assert target_blank(attrs) == attrs
Пример #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)
Пример #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'
     })
Пример #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",
     }
Пример #11
0
 def test_mailto(self):
     attrs = {(None, "href"): "mailto:[email protected]"}
     assert target_blank(attrs) == attrs
Пример #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'}
     )