Recognize non-ASCII whitespace around inline literal, target and substitution.
[docutils.git] / docutils / test / test_parsers / test_rst / test_inline_markup.py
blob94292791a32ae9675c39e71c12bc97473db23129
1 #! /usr/bin/env python
2 # -*- coding: utf-8 -*-
4 # $Id$
5 # Author: David Goodger <goodger@python.org>
6 # Copyright: This module has been placed in the public domain.
8 """
9 Tests for inline markup in docutils/parsers/rst/states.py.
10 Interpreted text tests are in a separate module, test_interpreted.py.
11 """
13 from __init__ import DocutilsTestSupport
15 def suite():
16 s = DocutilsTestSupport.ParserTestSuite()
17 s.generateTests(totest)
18 return s
20 totest = {}
22 totest['emphasis'] = [
23 ["""\
24 *emphasis*
25 """,
26 """\
27 <document source="test data">
28 <paragraph>
29 <emphasis>
30 emphasis
31 """],
32 [u"""\
33 l'*emphasis* with the *emphasis*' apostrophe.
34 l\u2019*emphasis* with the *emphasis*\u2019 apostrophe.
35 """,
36 u"""\
37 <document source="test data">
38 <paragraph>
39 l\'
40 <emphasis>
41 emphasis
42 with the \n\
43 <emphasis>
44 emphasis
45 \' apostrophe.
46 l\u2019
47 <emphasis>
48 emphasis
49 with the \n\
50 <emphasis>
51 emphasis
52 \u2019 apostrophe.
53 """],
54 ["""\
55 *emphasized sentence
56 across lines*
57 """,
58 """\
59 <document source="test data">
60 <paragraph>
61 <emphasis>
62 emphasized sentence
63 across lines
64 """],
65 ["""\
66 *emphasis without closing asterisk
67 """,
68 """\
69 <document source="test data">
70 <paragraph>
71 <problematic ids="id2" refid="id1">
73 emphasis without closing asterisk
74 <system_message backrefs="id2" ids="id1" level="2" line="1" source="test data" type="WARNING">
75 <paragraph>
76 Inline emphasis start-string without end-string.
77 """],
78 [r"""some punctuation is allowed around inline markup, e.g.
79 /*emphasis*/, -*emphasis*-, and :*emphasis*: (delimiters),
80 (*emphasis*), [*emphasis*], <*emphasis*>, {*emphasis*} (open/close pairs)
81 *emphasis*., *emphasis*,, *emphasis*!, and *emphasis*\ (closing delimiters),
83 but not
84 )*emphasis*(, ]*emphasis*[, >*emphasis*>, }*emphasis*{ (close/open pairs),
85 (*), [*], '*' or '"*"' ("quoted" start-string),
86 x*2* or 2*x* (alphanumeric char before),
87 \*args or * (escaped, whitespace behind start-string),
88 or *the\* *stars\* *inside* (escaped, whitespace before end-string).
90 However, '*args' will trigger a warning and may be problematic.
92 what about *this**?
93 """,
94 """\
95 <document source="test data">
96 <paragraph>
97 some punctuation is allowed around inline markup, e.g.
99 <emphasis>
100 emphasis
101 /, -
102 <emphasis>
103 emphasis
104 -, and :
105 <emphasis>
106 emphasis
107 : (delimiters),
109 <emphasis>
110 emphasis
111 ), [
112 <emphasis>
113 emphasis
114 ], <
115 <emphasis>
116 emphasis
117 >, {
118 <emphasis>
119 emphasis
120 } (open/close pairs)
121 <emphasis>
122 emphasis
123 ., \n\
124 <emphasis>
125 emphasis
126 ,, \n\
127 <emphasis>
128 emphasis
129 !, and \n\
130 <emphasis>
131 emphasis
132 (closing delimiters),
133 <paragraph>
134 but not
135 )*emphasis*(, ]*emphasis*[, >*emphasis*>, }*emphasis*{ (close/open pairs),
136 (*), [*], '*' or '"*"' ("quoted" start-string),
137 x*2* or 2*x* (alphanumeric char before),
138 *args or * (escaped, whitespace behind start-string),
139 or \n\
140 <emphasis>
141 the* *stars* *inside
142 (escaped, whitespace before end-string).
143 <paragraph>
144 However, '
145 <problematic ids="id2" refid="id1">
147 args' will trigger a warning and may be problematic.
148 <system_message backrefs="id2" ids="id1" level="2" line="13" source="test data" type="WARNING">
149 <paragraph>
150 Inline emphasis start-string without end-string.
151 <paragraph>
152 what about \n\
153 <emphasis>
154 this*
156 """],
157 [u"""\
158 Quotes around inline markup:
160 '*emphasis*' "*emphasis*" Straight,
161 ‘*emphasis*’ “*emphasis*” English, ...,
162 « *emphasis* » ‹ *emphasis* › « *emphasis* » ‹ *emphasis* ›
163 « *emphasis* » ‹ *emphasis* › French,
164 „*emphasis*“ ‚*emphasis*‘ »*emphasis*« ›*emphasis*‹ German, Czech, ...,
165 „*emphasis*” «*emphasis*» Romanian,
166 “*emphasis*„ ‘*emphasis*‚ Greek,
167 「*emphasis*」 『*emphasis*』traditional Chinese,
168 ”*emphasis*” ’*emphasis*’ »*emphasis*» ›*emphasis*› Swedish, Finnish,
169 „*emphasis*” ‚*emphasis*’ Polish,
170 „*emphasis*” »*emphasis*« ’*emphasis*’ Hungarian,
171 """,
172 u"""\
173 <document source="test data">
174 <paragraph>
175 Quotes around inline markup:
176 <paragraph>
178 <emphasis>
179 emphasis
180 \' "
181 <emphasis>
182 emphasis
183 " Straight,
184 \u2018
185 <emphasis>
186 emphasis
187 \u2019 \u201c
188 <emphasis>
189 emphasis
190 \u201d English, ...,
191 \xab\u202f
192 <emphasis>
193 emphasis
194 \u202f\xbb \u2039\u202f
195 <emphasis>
196 emphasis
197 \u202f\u203a \xab\xa0
198 <emphasis>
199 emphasis
200 \xa0\xbb \u2039\xa0
201 <emphasis>
202 emphasis
203 \xa0\u203a
204 \xab\u2005
205 <emphasis>
206 emphasis
207 \u2005\xbb \u2039\u2005
208 <emphasis>
209 emphasis
210 \u2005\u203a French,
211 \u201e
212 <emphasis>
213 emphasis
214 \u201c \u201a
215 <emphasis>
216 emphasis
217 \u2018 \xbb
218 <emphasis>
219 emphasis
220 \xab \u203a
221 <emphasis>
222 emphasis
223 \u2039 German, Czech, ...,
224 \u201e
225 <emphasis>
226 emphasis
227 \u201d \xab
228 <emphasis>
229 emphasis
230 \xbb Romanian,
231 \u201c
232 <emphasis>
233 emphasis
234 \u201e \u2018
235 <emphasis>
236 emphasis
237 \u201a Greek,
238 \u300c
239 <emphasis>
240 emphasis
241 \u300d \u300e
242 <emphasis>
243 emphasis
244 \u300ftraditional Chinese,
245 \u201d
246 <emphasis>
247 emphasis
248 \u201d \u2019
249 <emphasis>
250 emphasis
251 \u2019 \xbb
252 <emphasis>
253 emphasis
254 \xbb \u203a
255 <emphasis>
256 emphasis
257 \u203a Swedish, Finnish,
258 \u201e
259 <emphasis>
260 emphasis
261 \u201d \u201a
262 <emphasis>
263 emphasis
264 \u2019 Polish,
265 \u201e
266 <emphasis>
267 emphasis
268 \u201d \xbb
269 <emphasis>
270 emphasis
271 \xab \u2019
272 <emphasis>
273 emphasis
274 \u2019 Hungarian,
275 """],
276 [r"""
277 Emphasized asterisk: *\**
279 Emphasized double asterisk: *\***
280 """,
281 """\
282 <document source="test data">
283 <paragraph>
284 Emphasized asterisk: \n\
285 <emphasis>
287 <paragraph>
288 Emphasized double asterisk: \n\
289 <emphasis>
291 """],
294 totest['strong'] = [
295 ["""\
296 **strong**
297 """,
298 """\
299 <document source="test data">
300 <paragraph>
301 <strong>
302 strong
303 """],
304 [u"""\
305 l'**strong** and l\u2019**strong** with apostrophe
306 """,
307 u"""\
308 <document source="test data">
309 <paragraph>
311 <strong>
312 strong
313 and l\u2019
314 <strong>
315 strong
316 with apostrophe
317 """],
318 [u"""\
319 quoted '**strong**', quoted "**strong**",
320 quoted \u2018**strong**\u2019, quoted \u201c**strong**\u201d,
321 quoted \xab**strong**\xbb
322 """,
323 u"""\
324 <document source="test data">
325 <paragraph>
326 quoted '
327 <strong>
328 strong
329 ', quoted "
330 <strong>
331 strong
333 quoted \u2018
334 <strong>
335 strong
336 \u2019, quoted \u201c
337 <strong>
338 strong
339 \u201d,
340 quoted \xab
341 <strong>
342 strong
343 \xbb
344 """],
345 [r"""
346 (**strong**) but not (**) or '(** ' or x**2 or \**kwargs or **
348 (however, '**kwargs' will trigger a warning and may be problematic)
349 """,
350 """\
351 <document source="test data">
352 <paragraph>
354 <strong>
355 strong
356 ) but not (**) or '(** ' or x**2 or **kwargs or **
357 <paragraph>
358 (however, '
359 <problematic ids="id2" refid="id1">
361 kwargs' will trigger a warning and may be problematic)
362 <system_message backrefs="id2" ids="id1" level="2" line="4" source="test data" type="WARNING">
363 <paragraph>
364 Inline strong start-string without end-string.
365 """],
366 ["""\
367 Strong asterisk: *****
369 Strong double asterisk: ******
370 """,
371 """\
372 <document source="test data">
373 <paragraph>
374 Strong asterisk: \n\
375 <strong>
377 <paragraph>
378 Strong double asterisk: \n\
379 <strong>
381 """],
382 ["""\
383 **strong without closing asterisks
384 """,
385 """\
386 <document source="test data">
387 <paragraph>
388 <problematic ids="id2" refid="id1">
390 strong without closing asterisks
391 <system_message backrefs="id2" ids="id1" level="2" line="1" source="test data" type="WARNING">
392 <paragraph>
393 Inline strong start-string without end-string.
394 """],
397 totest['literal'] = [
398 ["""\
399 ``literal``
400 """,
401 """\
402 <document source="test data">
403 <paragraph>
404 <literal>
405 literal
406 """],
407 [r"""
408 ``\literal``
409 """,
410 """\
411 <document source="test data">
412 <paragraph>
413 <literal>
414 \\literal
415 """],
416 [r"""
417 ``lite\ral``
418 """,
419 """\
420 <document source="test data">
421 <paragraph>
422 <literal>
423 lite\\ral
424 """],
425 [r"""
426 ``literal\``
427 """,
428 """\
429 <document source="test data">
430 <paragraph>
431 <literal>
432 literal\\
433 """],
434 [u"""\
435 l'``literal`` and l\u2019``literal`` with apostrophe
436 """,
437 u"""\
438 <document source="test data">
439 <paragraph>
441 <literal>
442 literal
443 and l\u2019
444 <literal>
445 literal
446 with apostrophe
447 """],
448 [u"""\
449 quoted '``literal``', quoted "``literal``",
450 quoted \u2018``literal``\u2019, quoted \u201c``literal``\u201d,
451 quoted \xab``literal``\xbb
452 """,
453 u"""\
454 <document source="test data">
455 <paragraph>
456 quoted '
457 <literal>
458 literal
459 ', quoted "
460 <literal>
461 literal
463 quoted \u2018
464 <literal>
465 literal
466 \u2019, quoted \u201c
467 <literal>
468 literal
469 \u201d,
470 quoted \xab
471 <literal>
472 literal
473 \xbb
474 """],
475 [u"""\
476 ``'literal'`` with quotes, ``"literal"`` with quotes,
477 ``\u2018literal\u2019`` with quotes, ``\u201cliteral\u201d`` with quotes,
478 ``\xabliteral\xbb`` with quotes
479 """,
480 u"""\
481 <document source="test data">
482 <paragraph>
483 <literal>
484 'literal'
485 with quotes, \n\
486 <literal>
487 "literal"
488 with quotes,
489 <literal>
490 \u2018literal\u2019
491 with quotes, \n\
492 <literal>
493 \u201cliteral\u201d
494 with quotes,
495 <literal>
496 \xabliteral\xbb
497 with quotes
498 """],
499 [r"""
500 ``literal ``TeX quotes'' & \backslash`` but not "``" or ``
502 (however, ``standalone TeX quotes'' will trigger a warning
503 and may be problematic)
504 """,
505 """\
506 <document source="test data">
507 <paragraph>
508 <literal>
509 literal ``TeX quotes'' & \\backslash
510 but not "``" or ``
511 <paragraph>
512 (however, \n\
513 <problematic ids="id2" refid="id1">
515 standalone TeX quotes'' will trigger a warning
516 and may be problematic)
517 <system_message backrefs="id2" ids="id1" level="2" line="4" source="test data" type="WARNING">
518 <paragraph>
519 Inline literal start-string without end-string.
520 """],
521 ["""\
522 Find the ```interpreted text``` in this paragraph!
523 """,
524 """\
525 <document source="test data">
526 <paragraph>
527 Find the \n\
528 <literal>
529 `interpreted text`
530 in this paragraph!
531 """],
532 ["""\
533 ``literal without closing backquotes
534 """,
535 """\
536 <document source="test data">
537 <paragraph>
538 <problematic ids="id2" refid="id1">
540 literal without closing backquotes
541 <system_message backrefs="id2" ids="id1" level="2" line="1" source="test data" type="WARNING">
542 <paragraph>
543 Inline literal start-string without end-string.
544 """],
545 [r"""
546 Python ``list``\s use square bracket syntax.
547 """,
548 """\
549 <document source="test data">
550 <paragraph>
551 Python \n\
552 <literal>
553 list
554 s use square bracket syntax.
555 """],
558 totest['references'] = [
559 ["""\
560 ref_
561 """,
562 """\
563 <document source="test data">
564 <paragraph>
565 <reference name="ref" refname="ref">
567 """],
568 [u"""\
569 l'ref_ and l\u2019ref_ with apostrophe
570 """,
571 u"""\
572 <document source="test data">
573 <paragraph>
575 <reference name="ref" refname="ref">
577 and l\u2019
578 <reference name="ref" refname="ref">
580 with apostrophe
581 """],
582 [u"""\
583 quoted 'ref_', quoted "ref_",
584 quoted \u2018ref_\u2019, quoted \u201cref_\u201d,
585 quoted \xabref_\xbb,
586 but not 'ref ref'_, "ref ref"_, \u2018ref ref\u2019_,
587 \u201cref ref\u201d_, or \xabref ref\xbb_
588 """,
589 u"""\
590 <document source="test data">
591 <paragraph>
592 quoted '
593 <reference name="ref" refname="ref">
595 ', quoted "
596 <reference name="ref" refname="ref">
599 quoted \u2018
600 <reference name="ref" refname="ref">
602 \u2019, quoted \u201c
603 <reference name="ref" refname="ref">
605 \u201d,
606 quoted \xab
607 <reference name="ref" refname="ref">
609 \xbb,
610 but not 'ref ref'_, "ref ref"_, \u2018ref ref\u2019_,
611 \u201cref ref\u201d_, or \xabref ref\xbb_
612 """],
613 ["""\
614 ref__
615 """,
616 """\
617 <document source="test data">
618 <paragraph>
619 <reference anonymous="1" name="ref">
621 """],
622 [u"""\
623 l'ref__ and l\u2019ref__ with apostrophe
624 """,
625 u"""\
626 <document source="test data">
627 <paragraph>
629 <reference anonymous="1" name="ref">
631 and l\u2019
632 <reference anonymous="1" name="ref">
634 with apostrophe
635 """],
636 [u"""\
637 quoted 'ref__', quoted "ref__",
638 quoted \u2018ref__\u2019, quoted \u201cref__\u201d,
639 quoted \xabref__\xbb,
640 but not 'ref ref'__, "ref ref"__, \u2018ref ref\u2019__,
641 \u201cref ref\u201d__, or \xabref ref\xbb__
642 """,
643 u"""\
644 <document source="test data">
645 <paragraph>
646 quoted '
647 <reference anonymous="1" name="ref">
649 ', quoted "
650 <reference anonymous="1" name="ref">
653 quoted \u2018
654 <reference anonymous="1" name="ref">
656 \u2019, quoted \u201c
657 <reference anonymous="1" name="ref">
659 \u201d,
660 quoted \xab
661 <reference anonymous="1" name="ref">
663 \xbb,
664 but not 'ref ref'__, "ref ref"__, \u2018ref ref\u2019__,
665 \u201cref ref\u201d__, or \xabref ref\xbb__
666 """],
667 ["""\
668 ref_, r_, r_e-f_, -ref_, and anonymousref__,
669 but not _ref_ or __attr__ or object.__attr__
670 """,
671 """\
672 <document source="test data">
673 <paragraph>
674 <reference name="ref" refname="ref">
676 , \n\
677 <reference name="r" refname="r">
679 , \n\
680 <reference name="r_e-f" refname="r_e-f">
681 r_e-f
683 <reference name="ref" refname="ref">
685 , and \n\
686 <reference anonymous="1" name="anonymousref">
687 anonymousref
689 but not _ref_ or __attr__ or object.__attr__
690 """],
693 totest['phrase_references'] = [
694 ["""\
695 `phrase reference`_
696 """,
697 """\
698 <document source="test data">
699 <paragraph>
700 <reference name="phrase reference" refname="phrase reference">
701 phrase reference
702 """],
703 [u"""\
704 l'`phrase reference`_ and l\u2019`phrase reference`_ with apostrophe
705 """,
706 u"""\
707 <document source="test data">
708 <paragraph>
710 <reference name="phrase reference" refname="phrase reference">
711 phrase reference
712 and l\u2019
713 <reference name="phrase reference" refname="phrase reference">
714 phrase reference
715 with apostrophe
716 """],
717 [u"""\
718 quoted '`phrase reference`_', quoted "`phrase reference`_",
719 quoted \u2018`phrase reference`_\u2019,
720 quoted \u201c`phrase reference`_\u201d,
721 quoted \xab`phrase reference`_\xbb
722 """,
723 u"""\
724 <document source="test data">
725 <paragraph>
726 quoted '
727 <reference name="phrase reference" refname="phrase reference">
728 phrase reference
729 ', quoted "
730 <reference name="phrase reference" refname="phrase reference">
731 phrase reference
733 quoted \u2018
734 <reference name="phrase reference" refname="phrase reference">
735 phrase reference
736 \u2019,
737 quoted \u201c
738 <reference name="phrase reference" refname="phrase reference">
739 phrase reference
740 \u201d,
741 quoted \xab
742 <reference name="phrase reference" refname="phrase reference">
743 phrase reference
744 \xbb
745 """],
746 [u"""\
747 `'phrase reference'`_ with quotes, `"phrase reference"`_ with quotes,
748 `\u2018phrase reference\u2019`_ with quotes,
749 `\u201cphrase reference\u201d`_ with quotes,
750 `\xabphrase reference\xbb`_ with quotes
751 """,
752 u"""\
753 <document source="test data">
754 <paragraph>
755 <reference name="'phrase reference'" refname="'phrase reference'">
756 'phrase reference'
757 with quotes, \n\
758 <reference name=""phrase reference"" refname=""phrase reference"">
759 "phrase reference"
760 with quotes,
761 <reference name="\u2018phrase reference\u2019" refname="\u2018phrase reference\u2019">
762 \u2018phrase reference\u2019
763 with quotes,
764 <reference name="\u201cphrase reference\u201d" refname="\u201cphrase reference\u201d">
765 \u201cphrase reference\u201d
766 with quotes,
767 <reference name="\xabphrase reference\xbb" refname="\xabphrase reference\xbb">
768 \xabphrase reference\xbb
769 with quotes
770 """],
771 ["""\
772 `anonymous reference`__
773 """,
774 """\
775 <document source="test data">
776 <paragraph>
777 <reference anonymous="1" name="anonymous reference">
778 anonymous reference
779 """],
780 [u"""\
781 l'`anonymous reference`__ and l\u2019`anonymous reference`__ with apostrophe
782 """,
783 u"""\
784 <document source="test data">
785 <paragraph>
787 <reference anonymous="1" name="anonymous reference">
788 anonymous reference
789 and l\u2019
790 <reference anonymous="1" name="anonymous reference">
791 anonymous reference
792 with apostrophe
793 """],
794 [u"""\
795 quoted '`anonymous reference`__', quoted "`anonymous reference`__",
796 quoted \u2018`anonymous reference`__\u2019,
797 quoted \u201c`anonymous reference`__\u201d,
798 quoted \xab`anonymous reference`__\xbb
799 """,
800 u"""\
801 <document source="test data">
802 <paragraph>
803 quoted '
804 <reference anonymous="1" name="anonymous reference">
805 anonymous reference
806 ', quoted "
807 <reference anonymous="1" name="anonymous reference">
808 anonymous reference
810 quoted \u2018
811 <reference anonymous="1" name="anonymous reference">
812 anonymous reference
813 \u2019,
814 quoted \u201c
815 <reference anonymous="1" name="anonymous reference">
816 anonymous reference
817 \u201d,
818 quoted \xab
819 <reference anonymous="1" name="anonymous reference">
820 anonymous reference
821 \xbb
822 """],
823 [u"""\
824 `'anonymous reference'`__ with quotes, `"anonymous reference"`__ with quotes,
825 `\u2018anonymous reference\u2019`__ with quotes,
826 `\u201canonymous reference\u201d`__ with quotes,
827 `\xabanonymous reference\xbb`__ with quotes
828 """,
829 u"""\
830 <document source="test data">
831 <paragraph>
832 <reference anonymous="1" name="'anonymous reference'">
833 'anonymous reference'
834 with quotes, \n\
835 <reference anonymous="1" name=""anonymous reference"">
836 "anonymous reference"
837 with quotes,
838 <reference anonymous="1" name="\u2018anonymous reference\u2019">
839 \u2018anonymous reference\u2019
840 with quotes,
841 <reference anonymous="1" name="\u201canonymous reference\u201d">
842 \u201canonymous reference\u201d
843 with quotes,
844 <reference anonymous="1" name="\xabanonymous reference\xbb">
845 \xabanonymous reference\xbb
846 with quotes
847 """],
848 ["""\
849 `phrase reference
850 across lines`_
851 """,
852 """\
853 <document source="test data">
854 <paragraph>
855 <reference name="phrase reference across lines" refname="phrase reference across lines">
856 phrase reference
857 across lines
858 """],
859 ["""\
860 `phrase\`_ reference`_
861 """,
862 """\
863 <document source="test data">
864 <paragraph>
865 <reference name="phrase`_ reference" refname="phrase`_ reference">
866 phrase`_ reference
867 """],
868 ["""\
869 Invalid phrase reference:
871 :role:`phrase reference`_
872 """,
873 """\
874 <document source="test data">
875 <paragraph>
876 Invalid phrase reference:
877 <paragraph>
878 <problematic ids="id2" refid="id1">
879 :role:`phrase reference`_
880 <system_message backrefs="id2" ids="id1" level="2" line="3" source="test data" type="WARNING">
881 <paragraph>
882 Mismatch: both interpreted text role prefix and reference suffix.
883 """],
884 ["""\
885 Invalid phrase reference:
887 `phrase reference`:role:_
888 """,
889 """\
890 <document source="test data">
891 <paragraph>
892 Invalid phrase reference:
893 <paragraph>
894 <problematic ids="id2" refid="id1">
895 `phrase reference`:role:_
896 <system_message backrefs="id2" ids="id1" level="2" line="3" source="test data" type="WARNING">
897 <paragraph>
898 Mismatch: both interpreted text role suffix and reference suffix.
899 """],
900 ["""\
901 `phrase reference_ without closing backquote
902 """,
903 """\
904 <document source="test data">
905 <paragraph>
906 <problematic ids="id2" refid="id1">
908 phrase \n\
909 <reference name="reference" refname="reference">
910 reference
911 without closing backquote
912 <system_message backrefs="id2" ids="id1" level="2" line="1" source="test data" type="WARNING">
913 <paragraph>
914 Inline interpreted text or phrase reference start-string without end-string.
915 """],
916 ["""\
917 `anonymous phrase reference__ without closing backquote
918 """,
919 """\
920 <document source="test data">
921 <paragraph>
922 <problematic ids="id2" refid="id1">
924 anonymous phrase \n\
925 <reference anonymous="1" name="reference">
926 reference
927 without closing backquote
928 <system_message backrefs="id2" ids="id1" level="2" line="1" source="test data" type="WARNING">
929 <paragraph>
930 Inline interpreted text or phrase reference start-string without end-string.
931 """],
934 totest['embedded_URIs'] = [
935 ["""\
936 `phrase reference <http://example.com>`_
937 """,
938 """\
939 <document source="test data">
940 <paragraph>
941 <reference name="phrase reference" refuri="http://example.com">
942 phrase reference
943 <target ids="phrase-reference" names="phrase\ reference" refuri="http://example.com">
944 """],
945 ["""\
946 `anonymous reference <http://example.com>`__
947 """,
948 """\
949 <document source="test data">
950 <paragraph>
951 <reference name="anonymous reference" refuri="http://example.com">
952 anonymous reference
953 """],
954 ["""\
955 `embedded URI on next line
956 <http://example.com>`__
957 """,
958 """\
959 <document source="test data">
960 <paragraph>
961 <reference name="embedded URI on next line" refuri="http://example.com">
962 embedded URI on next line
963 """],
964 ["""\
965 `embedded URI across lines <http://example.com/
966 long/path>`__
967 """,
968 """\
969 <document source="test data">
970 <paragraph>
971 <reference name="embedded URI across lines" refuri="http://example.com/long/path">
972 embedded URI across lines
973 """],
974 ["""\
975 `embedded URI with whitespace <http://example.com/
976 long/path /and /whitespace>`__
977 """,
978 """\
979 <document source="test data">
980 <paragraph>
981 <reference name="embedded URI with whitespace" refuri="http://example.com/long/path/and/whitespace">
982 embedded URI with whitespace
983 """],
984 [r"""
985 `embedded URI with escaped whitespace <http://example.com/a\
986 long/path\ and/some\ escaped\ whitespace>`__
988 `<omitted\ reference\ text\ with\ escaped\ whitespace>`__
989 """,
990 """\
991 <document source="test data">
992 <paragraph>
993 <reference name="embedded URI with escaped whitespace" refuri="http://example.com/a long/path and/some escaped whitespace">
994 embedded URI with escaped whitespace
995 <paragraph>
996 <reference name="omitted reference text with escaped whitespace" refuri="omitted reference text with escaped whitespace">
997 omitted reference text with escaped whitespace
998 """],
999 ["""\
1000 `embedded email address <jdoe@example.com>`__
1002 `embedded email address broken across lines <jdoe
1003 @example.com>`__
1004 """,
1005 """\
1006 <document source="test data">
1007 <paragraph>
1008 <reference name="embedded email address" refuri="mailto:jdoe@example.com">
1009 embedded email address
1010 <paragraph>
1011 <reference name="embedded email address broken across lines" refuri="mailto:jdoe@example.com">
1012 embedded email address broken across lines
1013 """],
1014 [r"""
1015 `embedded URI with too much whitespace < http://example.com/
1016 long/path /and /whitespace >`__
1018 `embedded URI with too much whitespace at end <http://example.com/
1019 long/path /and /whitespace >`__
1021 `embedded URI with no preceding whitespace<http://example.com>`__
1023 `escaped URI \<http://example.com>`__
1025 See `HTML Anchors: \<a>`_.
1026 """,
1027 """\
1028 <document source="test data">
1029 <paragraph>
1030 <reference anonymous="1" name="embedded URI with too much whitespace < http://example.com/ long/path /and /whitespace >">
1031 embedded URI with too much whitespace < http://example.com/
1032 long/path /and /whitespace >
1033 <paragraph>
1034 <reference anonymous="1" name="embedded URI with too much whitespace at end <http://example.com/ long/path /and /whitespace >">
1035 embedded URI with too much whitespace at end <http://example.com/
1036 long/path /and /whitespace >
1037 <paragraph>
1038 <reference anonymous="1" name="embedded URI with no preceding whitespace<http://example.com>">
1039 embedded URI with no preceding whitespace<http://example.com>
1040 <paragraph>
1041 <reference anonymous="1" name="escaped URI <http://example.com>">
1042 escaped URI <http://example.com>
1043 <paragraph>
1044 See \n\
1045 <reference name="HTML Anchors: <a>" refname="html anchors: <a>">
1046 HTML Anchors: <a>
1048 """],
1049 ["""\
1050 Relative URIs' reference text can be omitted:
1052 `<reference>`_
1054 `<anonymous>`__
1055 """,
1056 """\
1057 <document source="test data">
1058 <paragraph>
1059 Relative URIs' reference text can be omitted:
1060 <paragraph>
1061 <reference name="reference" refuri="reference">
1062 reference
1063 <target ids="reference" names="reference" refuri="reference">
1064 <paragraph>
1065 <reference name="anonymous" refuri="anonymous">
1066 anonymous
1067 """],
1068 [r"""
1069 Escape trailing low-line char in URIs:
1071 `<reference\_>`_
1073 `<anonymous\_>`__
1074 """,
1075 """\
1076 <document source="test data">
1077 <paragraph>
1078 Escape trailing low-line char in URIs:
1079 <paragraph>
1080 <reference name="reference_" refuri="reference_">
1081 reference_
1082 <target ids="reference" names="reference_" refuri="reference_">
1083 <paragraph>
1084 <reference name="anonymous_" refuri="anonymous_">
1085 anonymous_
1086 """],
1087 ["""\
1088 Escape other char in URIs:
1090 `<reference\:1>`_
1092 `<anonymous\\call>`__
1093 """,
1094 """\
1095 <document source="test data">
1096 <paragraph>
1097 Escape other char in URIs:
1098 <paragraph>
1099 <reference name="reference:1" refuri="reference:1">
1100 reference:1
1101 <target ids="reference-1" names="reference:1" refuri="reference:1">
1102 <paragraph>
1103 <reference name="anonymouscall" refuri="anonymouscall">
1104 anonymouscall
1105 """],
1108 totest['embedded_aliases'] = [
1109 ["""\
1110 `phrase reference <alias_>`_
1111 """,
1112 """\
1113 <document source="test data">
1114 <paragraph>
1115 <reference name="phrase reference" refname="alias">
1116 phrase reference
1117 <target names="phrase\ reference" refname="alias">
1118 """],
1119 ["""\
1120 `anonymous reference <alias_>`__
1121 """,
1122 """\
1123 <document source="test data">
1124 <paragraph>
1125 <reference name="anonymous reference" refname="alias">
1126 anonymous reference
1127 """],
1128 ["""\
1129 `embedded alias on next line
1130 <alias_>`__
1131 """,
1132 """\
1133 <document source="test data">
1134 <paragraph>
1135 <reference name="embedded alias on next line" refname="alias">
1136 embedded alias on next line
1137 """],
1138 ["""\
1139 `embedded alias across lines <alias
1140 phrase_>`__
1141 """,
1142 """\
1143 <document source="test data">
1144 <paragraph>
1145 <reference name="embedded alias across lines" refname="alias phrase">
1146 embedded alias across lines
1147 """],
1148 ["""\
1149 `embedded alias with whitespace <alias
1150 long phrase_>`__
1151 """,
1152 """\
1153 <document source="test data">
1154 <paragraph>
1155 <reference name="embedded alias with whitespace" refname="alias long phrase">
1156 embedded alias with whitespace
1157 """],
1158 ["""\
1159 `<embedded alias with whitespace_>`__
1160 """,
1161 """\
1162 <document source="test data">
1163 <paragraph>
1164 <reference name="embedded alias with whitespace" refname="embedded alias with whitespace">
1165 embedded alias with whitespace
1166 """],
1167 [r"""
1168 `no embedded alias (whitespace inside bracket) < alias_ >`__
1170 `no embedded alias (no preceding whitespace)<alias_>`__
1171 """,
1172 """\
1173 <document source="test data">
1174 <paragraph>
1175 <reference anonymous="1" name="no embedded alias (whitespace inside bracket) < alias_ >">
1176 no embedded alias (whitespace inside bracket) < alias_ >
1177 <paragraph>
1178 <reference anonymous="1" name="no embedded alias (no preceding whitespace)<alias_>">
1179 no embedded alias (no preceding whitespace)<alias_>
1180 """],
1181 [r"""
1182 `anonymous reference <alias\ with\\ escaped \:characters_>`__
1183 """,
1184 """\
1185 <document source="test data">
1186 <paragraph>
1187 <reference name="anonymous reference" refname="aliaswith\ escaped :characters">
1188 anonymous reference
1189 """],
1190 [r"""
1191 `anonymous reference <alias\ with\\ escaped \:characters_>`__
1192 """,
1193 """\
1194 <document source="test data">
1195 <paragraph>
1196 <reference name="anonymous reference" refname="aliaswith\ escaped :characters">
1197 anonymous reference
1198 """],
1201 totest['inline_targets'] = [
1202 ["""\
1203 _`target`
1205 Here is _`another target` in some text. And _`yet
1206 another target`, spanning lines.
1208 _`Here is a TaRgeT` with case and spacial difficulties.
1209 """,
1210 """\
1211 <document source="test data">
1212 <paragraph>
1213 <target ids="target" names="target">
1214 target
1215 <paragraph>
1216 Here is \n\
1217 <target ids="another-target" names="another\ target">
1218 another target
1219 in some text. And \n\
1220 <target ids="yet-another-target" names="yet\ another\ target">
1222 another target
1223 , spanning lines.
1224 <paragraph>
1225 <target ids="here-is-a-target" names="here\ is\ a\ target">
1226 Here is a TaRgeT
1227 with case and spacial difficulties.
1228 """],
1229 [u"""\
1230 l'_`target1` and l\u2019_`target2` with apostrophe
1231 """,
1232 u"""\
1233 <document source="test data">
1234 <paragraph>
1236 <target ids="target1" names="target1">
1237 target1
1238 and l\u2019
1239 <target ids="target2" names="target2">
1240 target2
1241 with apostrophe
1242 """],
1243 [u"""\
1244 quoted '_`target1`', quoted "_`target2`",
1245 quoted \u2018_`target3`\u2019, quoted \u201c_`target4`\u201d,
1246 quoted \xab_`target5`\xbb
1247 """,
1248 u"""\
1249 <document source="test data">
1250 <paragraph>
1251 quoted '
1252 <target ids="target1" names="target1">
1253 target1
1254 ', quoted "
1255 <target ids="target2" names="target2">
1256 target2
1258 quoted \u2018
1259 <target ids="target3" names="target3">
1260 target3
1261 \u2019, quoted \u201c
1262 <target ids="target4" names="target4">
1263 target4
1264 \u201d,
1265 quoted \xab
1266 <target ids="target5" names="target5">
1267 target5
1268 \xbb
1269 """],
1270 [u"""\
1271 _`'target1'` with quotes, _`"target2"` with quotes,
1272 _`\u2018target3\u2019` with quotes, _`\u201ctarget4\u201d` with quotes,
1273 _`\xabtarget5\xbb` with quotes
1274 """,
1275 u"""\
1276 <document source="test data">
1277 <paragraph>
1278 <target ids="target1" names="'target1'">
1279 'target1'
1280 with quotes, \n\
1281 <target ids="target2" names=""target2"">
1282 "target2"
1283 with quotes,
1284 <target ids="target3" names="\u2018target3\u2019">
1285 \u2018target3\u2019
1286 with quotes, \n\
1287 <target ids="target4" names="\u201ctarget4\u201d">
1288 \u201ctarget4\u201d
1289 with quotes,
1290 <target ids="target5" names="\xabtarget5\xbb">
1291 \xabtarget5\xbb
1292 with quotes
1293 """],
1294 ["""\
1295 But this isn't a _target; targets require backquotes.
1297 And _`this`_ is just plain confusing.
1298 """,
1299 """\
1300 <document source="test data">
1301 <paragraph>
1302 But this isn't a _target; targets require backquotes.
1303 <paragraph>
1304 And \n\
1305 <problematic ids="id2" refid="id1">
1307 this`_ is just plain confusing.
1308 <system_message backrefs="id2" ids="id1" level="2" line="3" source="test data" type="WARNING">
1309 <paragraph>
1310 Inline target start-string without end-string.
1311 """],
1312 ["""\
1313 _`inline target without closing backquote
1314 """,
1315 """\
1316 <document source="test data">
1317 <paragraph>
1318 <problematic ids="id2" refid="id1">
1320 inline target without closing backquote
1321 <system_message backrefs="id2" ids="id1" level="2" line="1" source="test data" type="WARNING">
1322 <paragraph>
1323 Inline target start-string without end-string.
1324 """],
1327 totest['footnote_reference'] = [
1328 ["""\
1329 [1]_
1330 """,
1331 """\
1332 <document source="test data">
1333 <paragraph>
1334 <footnote_reference ids="id1" refname="1">
1336 """],
1337 ["""\
1338 [#]_
1339 """,
1340 """\
1341 <document source="test data">
1342 <paragraph>
1343 <footnote_reference auto="1" ids="id1">
1344 """],
1345 ["""\
1346 [#label]_
1347 """,
1348 """\
1349 <document source="test data">
1350 <paragraph>
1351 <footnote_reference auto="1" ids="id1" refname="label">
1352 """],
1353 ["""\
1354 [*]_
1355 """,
1356 """\
1357 <document source="test data">
1358 <paragraph>
1359 <footnote_reference auto="*" ids="id1">
1360 """],
1361 ["""\
1362 Adjacent footnote refs are not possible: [*]_[#label]_ [#]_[2]_ [1]_[*]_
1363 """,
1364 """\
1365 <document source="test data">
1366 <paragraph>
1367 Adjacent footnote refs are not possible: [*]_[#label]_ [#]_[2]_ [1]_[*]_
1368 """],
1371 totest['citation_reference'] = [
1372 ["""\
1373 [citation]_
1374 """,
1375 """\
1376 <document source="test data">
1377 <paragraph>
1378 <citation_reference ids="id1" refname="citation">
1379 citation
1380 """],
1381 ["""\
1382 [citation]_ and [cit-ation]_ and [cit.ation]_ and [CIT1]_ but not [CIT 1]_
1383 """,
1384 """\
1385 <document source="test data">
1386 <paragraph>
1387 <citation_reference ids="id1" refname="citation">
1388 citation
1389 and \n\
1390 <citation_reference ids="id2" refname="cit-ation">
1391 cit-ation
1392 and \n\
1393 <citation_reference ids="id3" refname="cit.ation">
1394 cit.ation
1395 and \n\
1396 <citation_reference ids="id4" refname="cit1">
1397 CIT1
1398 but not [CIT 1]_
1399 """],
1400 ["""\
1401 Adjacent citation refs are not possible: [citation]_[CIT1]_
1402 """,
1403 """\
1404 <document source="test data">
1405 <paragraph>
1406 Adjacent citation refs are not possible: [citation]_[CIT1]_
1407 """],
1410 totest['substitution_references'] = [
1411 ["""\
1412 |subref|
1413 """,
1414 """\
1415 <document source="test data">
1416 <paragraph>
1417 <substitution_reference refname="subref">
1418 subref
1419 """],
1420 ["""\
1421 |subref|_ and |subref|__
1422 """,
1423 """\
1424 <document source="test data">
1425 <paragraph>
1426 <reference refname="subref">
1427 <substitution_reference refname="subref">
1428 subref
1429 and \n\
1430 <reference anonymous="1">
1431 <substitution_reference refname="subref">
1432 subref
1433 """],
1434 ["""\
1435 |substitution reference|
1436 """,
1437 """\
1438 <document source="test data">
1439 <paragraph>
1440 <substitution_reference refname="substitution reference">
1441 substitution reference
1442 """],
1443 ["""\
1444 |substitution
1445 reference|
1446 """,
1447 """\
1448 <document source="test data">
1449 <paragraph>
1450 <substitution_reference refname="substitution reference">
1451 substitution
1452 reference
1453 """],
1454 ["""\
1455 |substitution reference without closing verbar
1456 """,
1457 """\
1458 <document source="test data">
1459 <paragraph>
1460 <problematic ids="id2" refid="id1">
1462 substitution reference without closing verbar
1463 <system_message backrefs="id2" ids="id1" level="2" line="1" source="test data" type="WARNING">
1464 <paragraph>
1465 Inline substitution_reference start-string without end-string.
1466 """],
1467 ["""\
1468 first | then || and finally |||
1469 """,
1470 """\
1471 <document source="test data">
1472 <paragraph>
1473 first | then || and finally |||
1474 """],
1477 totest['standalone_hyperlink'] = [
1478 ["""\
1479 http://www.standalone.hyperlink.com
1481 http:/one-slash-only.absolute.path
1483 [http://example.com]
1485 (http://example.com)
1487 <http://example.com>
1489 http://[1080:0:0:0:8:800:200C:417A]/IPv6address.html
1491 http://[3ffe:2a00:100:7031::1] (the final "]" is ambiguous in text)
1493 http://[3ffe:2a00:100:7031::1]/
1495 mailto:someone@somewhere.com
1497 news:comp.lang.python
1499 An email address in a sentence: someone@somewhere.com.
1501 ftp://ends.with.a.period.
1503 (a.question.mark@end?)
1504 """,
1505 """\
1506 <document source="test data">
1507 <paragraph>
1508 <reference refuri="http://www.standalone.hyperlink.com">
1509 http://www.standalone.hyperlink.com
1510 <paragraph>
1511 <reference refuri="http:/one-slash-only.absolute.path">
1512 http:/one-slash-only.absolute.path
1513 <paragraph>
1515 <reference refuri="http://example.com">
1516 http://example.com
1518 <paragraph>
1520 <reference refuri="http://example.com">
1521 http://example.com
1523 <paragraph>
1525 <reference refuri="http://example.com">
1526 http://example.com
1528 <paragraph>
1529 <reference refuri="http://[1080:0:0:0:8:800:200C:417A]/IPv6address.html">
1530 http://[1080:0:0:0:8:800:200C:417A]/IPv6address.html
1531 <paragraph>
1532 <reference refuri="http://[3ffe:2a00:100:7031::1">
1533 http://[3ffe:2a00:100:7031::1
1534 ] (the final "]" is ambiguous in text)
1535 <paragraph>
1536 <reference refuri="http://[3ffe:2a00:100:7031::1]/">
1537 http://[3ffe:2a00:100:7031::1]/
1538 <paragraph>
1539 <reference refuri="mailto:someone@somewhere.com">
1540 mailto:someone@somewhere.com
1541 <paragraph>
1542 <reference refuri="news:comp.lang.python">
1543 news:comp.lang.python
1544 <paragraph>
1545 An email address in a sentence: \n\
1546 <reference refuri="mailto:someone@somewhere.com">
1547 someone@somewhere.com
1549 <paragraph>
1550 <reference refuri="ftp://ends.with.a.period">
1551 ftp://ends.with.a.period
1553 <paragraph>
1555 <reference refuri="mailto:a.question.mark@end">
1556 a.question.mark@end
1558 """],
1559 [r"""
1560 Valid URLs with escaped markup characters:
1562 http://example.com/\*content\*/whatever
1564 http://example.com/\*content*/whatever
1565 """,
1566 """\
1567 <document source="test data">
1568 <paragraph>
1569 Valid URLs with escaped markup characters:
1570 <paragraph>
1571 <reference refuri="http://example.com/*content*/whatever">
1572 http://example.com/*content*/whatever
1573 <paragraph>
1574 <reference refuri="http://example.com/*content*/whatever">
1575 http://example.com/*content*/whatever
1576 """],
1577 ["""\
1578 Valid URLs may end with punctuation inside "<>":
1580 <http://example.org/ends-with-dot.>
1581 """,
1582 """\
1583 <document source="test data">
1584 <paragraph>
1585 Valid URLs may end with punctuation inside "<>":
1586 <paragraph>
1588 <reference refuri="http://example.org/ends-with-dot.">
1589 http://example.org/ends-with-dot.
1591 """],
1592 ["""\
1593 Valid URLs with interesting endings:
1595 http://example.org/ends-with-pluses++
1596 """,
1597 """\
1598 <document source="test data">
1599 <paragraph>
1600 Valid URLs with interesting endings:
1601 <paragraph>
1602 <reference refuri="http://example.org/ends-with-pluses++">
1603 http://example.org/ends-with-pluses++
1604 """],
1605 ["""\
1606 None of these are standalone hyperlinks (their "schemes"
1607 are not recognized): signal:noise, a:b.
1608 """,
1609 """\
1610 <document source="test data">
1611 <paragraph>
1612 None of these are standalone hyperlinks (their "schemes"
1613 are not recognized): signal:noise, a:b.
1614 """],
1615 ["""\
1616 Escaped email addresses are not recognized: test\@example.org
1617 """,
1618 """\
1619 <document source="test data">
1620 <paragraph>
1621 Escaped email addresses are not recognized: test@example.org
1622 """],
1625 totest['markup recognition rules'] = [
1626 ["""\
1627 __This__ should be left alone.
1628 """,
1629 """\
1630 <document source="test data">
1631 <paragraph>
1632 __This__ should be left alone.
1633 """],
1634 [r"""
1635 Character-level m\ *a*\ **r**\ ``k``\ `u`:title:\p
1636 with backslash-escaped whitespace, including new\
1637 lines.
1638 """,
1639 """\
1640 <document source="test data">
1641 <paragraph>
1642 Character-level m
1643 <emphasis>
1645 <strong>
1647 <literal>
1649 <title_reference>
1652 with backslash-escaped whitespace, including newlines.
1653 """],
1654 [u"""\
1655 text-*separated*\u2010*by*\u2011*various*\u2012*dashes*\u2013*and*\u2014*hyphens*.
1656 \u00bf*punctuation*? \u00a1*examples*!\u00a0*\u00a0no-break-space\u00a0*.
1657 """,
1658 u"""\
1659 <document source="test data">
1660 <paragraph>
1661 text-
1662 <emphasis>
1663 separated
1664 \u2010
1665 <emphasis>
1667 \u2011
1668 <emphasis>
1669 various
1670 \u2012
1671 <emphasis>
1672 dashes
1673 \u2013
1674 <emphasis>
1676 \u2014
1677 <emphasis>
1678 hyphens
1680 \xbf
1681 <emphasis>
1682 punctuation
1683 ? \xa1
1684 <emphasis>
1685 examples
1686 !\xa0
1687 <emphasis>
1688 \u00a0no-break-space\u00a0
1690 """],
1691 # Whitespace characters:
1692 # \u180e*MONGOLIAN VOWEL SEPARATOR*\u180e, fails in Python 2.4
1693 [u"""\
1694 text separated by
1695 *newline*
1696 or *space* or one of
1697 \xa0*NO-BREAK SPACE*\xa0,
1698 \u1680*OGHAM SPACE MARK*\u1680,
1699 \u2000*EN QUAD*\u2000,
1700 \u2001*EM QUAD*\u2001,
1701 \u2002*EN SPACE*\u2002,
1702 \u2003*EM SPACE*\u2003,
1703 \u2004*THREE-PER-EM SPACE*\u2004,
1704 \u2005*FOUR-PER-EM SPACE*\u2005,
1705 \u2006*SIX-PER-EM SPACE*\u2006,
1706 \u2007*FIGURE SPACE*\u2007,
1707 \u2008*PUNCTUATION SPACE*\u2008,
1708 \u2009*THIN SPACE*\u2009,
1709 \u200a*HAIR SPACE*\u200a,
1710 \u202f*NARROW NO-BREAK SPACE*\u202f,
1711 \u205f*MEDIUM MATHEMATICAL SPACE*\u205f,
1712 \u3000*IDEOGRAPHIC SPACE*\u3000,
1713 \u2028*LINE SEPARATOR*\u2028
1714 """,
1715 u"""\
1716 <document source="test data">
1717 <paragraph>
1718 text separated by
1719 <emphasis>
1720 newline
1722 or \n\
1723 <emphasis>
1724 space
1725 or one of
1726 \xa0
1727 <emphasis>
1728 NO-BREAK SPACE
1729 \xa0,
1730 \u1680
1731 <emphasis>
1732 OGHAM SPACE MARK
1733 \u1680,
1734 \u2000
1735 <emphasis>
1736 EN QUAD
1737 \u2000,
1738 \u2001
1739 <emphasis>
1740 EM QUAD
1741 \u2001,
1742 \u2002
1743 <emphasis>
1744 EN SPACE
1745 \u2002,
1746 \u2003
1747 <emphasis>
1748 EM SPACE
1749 \u2003,
1750 \u2004
1751 <emphasis>
1752 THREE-PER-EM SPACE
1753 \u2004,
1754 \u2005
1755 <emphasis>
1756 FOUR-PER-EM SPACE
1757 \u2005,
1758 \u2006
1759 <emphasis>
1760 SIX-PER-EM SPACE
1761 \u2006,
1762 \u2007
1763 <emphasis>
1764 FIGURE SPACE
1765 \u2007,
1766 \u2008
1767 <emphasis>
1768 PUNCTUATION SPACE
1769 \u2008,
1770 \u2009
1771 <emphasis>
1772 THIN SPACE
1773 \u2009,
1774 \u200a
1775 <emphasis>
1776 HAIR SPACE
1777 \u200a,
1778 \u202f
1779 <emphasis>
1780 NARROW NO-BREAK SPACE
1781 \u202f,
1782 \u205f
1783 <emphasis>
1784 MEDIUM MATHEMATICAL SPACE
1785 \u205f,
1786 \u3000
1787 <emphasis>
1788 IDEOGRAPHIC SPACE
1789 \u3000,
1790 <paragraph>
1791 <emphasis>
1792 LINE SEPARATOR
1793 """],
1794 [u"""\
1795 inline markup separated by non-ASCII whitespace
1796 \xa0**NO-BREAK SPACE**\xa0, \xa0``NO-BREAK SPACE``\xa0, \xa0`NO-BREAK SPACE`\xa0,
1797 \u2000**EN QUAD**\u2000, \u2000``EN QUAD``\u2000, \u2000`EN QUAD`\u2000,
1798 \u202f**NARROW NBSP**\u202f, \u202f``NARROW NBSP``\u202f, \u202f`NARROW NBSP`\u202f,
1799 """,
1800 u"""\
1801 <document source="test data">
1802 <paragraph>
1803 inline markup separated by non-ASCII whitespace
1804 \xa0
1805 <strong>
1806 NO-BREAK SPACE
1807 \xa0, \xa0
1808 <literal>
1809 NO-BREAK SPACE
1810 \xa0, \xa0
1811 <title_reference>
1812 NO-BREAK SPACE
1813 \xa0,
1814 \u2000
1815 <strong>
1816 EN QUAD
1817 \u2000, \u2000
1818 <literal>
1819 EN QUAD
1820 \u2000, \u2000
1821 <title_reference>
1822 EN QUAD
1823 \u2000,
1824 \u202f
1825 <strong>
1826 NARROW NBSP
1827 \u202f, \u202f
1828 <literal>
1829 NARROW NBSP
1830 \u202f, \u202f
1831 <title_reference>
1832 NARROW NBSP
1833 \u202f,
1834 """],
1835 # « * » ‹ * › « * » ‹ * › « * » ‹ * › French,
1836 [u"""\
1837 "Quoted" markup start-string (matched openers & closers) -> no markup:
1839 '*' "*" (*) <*> [*] {*}
1840 ⁅*⁆
1842 Some international quoting styles:
1843 ‘*’ “*” English, ...,
1844 „*“ ‚*‘ »*« ›*‹ German, Czech, ...,
1845 „*” «*» Romanian,
1846 “*„ ‘*‚ Greek,
1847 「*」 『*』traditional Chinese,
1848 ”*” ’*’ »*» ›*› Swedish, Finnish,
1849 „*” ‚*’ Polish,
1850 „*” »*« ’*’ Hungarian,
1852 But this is „*’ emphasized »*‹.
1853 """,
1854 u"""\
1855 <document source="test data">
1856 <paragraph>
1857 "Quoted" markup start-string (matched openers & closers) -> no markup:
1858 <paragraph>
1859 '*' "*" (*) <*> [*] {*}
1860 ⁅*⁆
1861 <paragraph>
1862 Some international quoting styles:
1863 ‘*’ “*” English, ...,
1864 „*“ ‚*‘ »*« ›*‹ German, Czech, ...,
1865 „*” «*» Romanian,
1866 “*„ ‘*‚ Greek,
1867 「*」 『*』traditional Chinese,
1868 ”*” ’*’ »*» ›*› Swedish, Finnish,
1869 „*” ‚*’ Polish,
1870 „*” »*« ’*’ Hungarian,
1871 <paragraph>
1872 But this is „
1873 <emphasis>
1874 ’ emphasized »
1875 ‹.
1876 """],
1880 if __name__ == '__main__':
1881 import unittest
1882 unittest.main(defaultTest='suite')