changeset 2156:d174186b3600

Merged thomaswaldmann/moin-2.0 into default
author ana-balica <ana.balica@gmail.com>
date Sat, 20 Jul 2013 01:08:22 +0300
parents 2ffec8cc8d97 (current diff) 78ed0ce6b718 (diff)
children 52c47ef351dd
files
diffstat 1 files changed, 10 insertions(+), 8 deletions(-) [+]
line wrap: on
line diff
--- a/MoinMoin/converter/_tests/test_docbook_in.py	Sat Jul 20 01:04:05 2013 +0300
+++ b/MoinMoin/converter/_tests/test_docbook_in.py	Sat Jul 20 01:08:22 2013 +0300
@@ -256,13 +256,13 @@
     def test_link(self):
         data = [
             # Normal link, with conversion of all the xlink attributes
-            ('<article><para><link xlink:href="uri:test" xlink:title="title">link</link></para></article>',
-                # <page><body><div html:class="article"><p><a xlink:href="uri:test" xlink:title="title">link</a></p></div></body></page>
-                '/page/body/div/p/a[@xlink:href="uri:test"][@xlink:title="title"][text()="link"]'),
+            ('<article><para><link xlink:href="http:test" xlink:title="title">link</link></para></article>',
+                # <page><body><div html:class="article"><p><a xlink:href="http:test" xlink:title="title">link</a></p></div></body></page>
+                '/page/body/div/p/a[@xlink:href="http:test"][@xlink:title="title"][text()="link"]'),
             # Old link from DocBook v.4.X for backward compatibility
-            ('<article><para><ulink url="url:test">link</ulink></para></article>',
-                # <page><body><div html:class="article"><p><a xlink:href="url:test">link</a></p></div></body></page>
-                '/page/body/div/p/a[@xlink:href="url:test"][text()="link"]'),
+            ('<article><para><ulink url="http:test">link</ulink></para></article>',
+                # <page><body><div html:class="article"><p><a xlink:href="http:test">link</a></p></div></body></page>
+                '/page/body/div/p/a[@xlink:href="http:test"][text()="link"]'),
             # Normal link, with linkend attribute
             ('<article><para><link linkend="anchor">link</link></para></article>',
                 # <page><body><div html:class="article"><p><a xlink:href="#anchor">link</a></p></div></body></page>
@@ -273,8 +273,10 @@
                 '/page/body/div/p/a[@xlink:href="uri#anchor"][text()="link"]'),
             # Link w/ javascript: scheme
             ('<article><para><ulink url="javascript:alert(\'xss\')">link</ulink></para></article>',
-                # <page><body><div html:class="article"><p><a xlink:href="url:test">link</a></p></div></body></page>
-                '/page/body/div/p/a[@xlink:href=""][text()="link"]'),
+                # the href attribute will default to None because javascript is not an allowed url scheme
+                # we don't care how it gets rendered as long as the javascript doesn't show up
+                # <page><body><div html:class="article"><p><a xlink:href="None">link</a></p></div></body></page>
+                '/page/body/div/p/a[@xlink:href="None"][text()="link"]'),
         ]
         for i in data:
             yield (self.do, ) + i