5 # Author: David Goodger <goodger@python.org>
6 # Copyright: This module has been placed in the public domain.
9 Tests for inline markup in docutils/parsers/rst/states.py.
10 Interpreted text tests are in a separate module, test_interpreted.py.
13 from __init__
import DocutilsTestSupport
16 s
= DocutilsTestSupport
.ParserTestSuite()
17 s
.generateTests(totest
)
22 totest
['emphasis'] = [
27 <document source="test data">
33 l'*emphasis* with the *emphasis*' apostrophe.
34 l\u2019*emphasis* with the *emphasis*\u2019 apostrophe.
37 <document source="test data">
59 <document source="test data">
66 *emphasis without closing asterisk
69 <document source="test data">
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">
76 Inline emphasis start-string without end-string.
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)
83 )*emphasis*(, ]*emphasis*[, >*emphasis*>, }*emphasis*{ (close/open pairs)
84 (*), [*], '*' or '"*"' ("quoted" start-string),
85 x*2* or 2*x* (alphanumeric char before),
86 \*args or * (escaped, whitespace behind start-string)
87 or *the\* *stars\* *inside* (escaped, whitespace before end-string).
89 However, '*args' will trigger a warning and may be problematic.
94 <document source="test data">
96 some punctuation is allowed around inline markup, e.g.
122 )*emphasis*(, ]*emphasis*[, >*emphasis*>, }*emphasis*{ (close/open pairs)
123 (*), [*], '*' or '"*"' ("quoted" start-string),
124 x*2* or 2*x* (alphanumeric char before),
125 *args or * (escaped, whitespace behind start-string)
129 (escaped, whitespace before end-string).
132 <problematic ids="id2" refid="id1">
134 args' will trigger a warning and may be problematic.
135 <system_message backrefs="id2" ids="id1" level="2" line="12" source="test data" type="WARNING">
137 Inline emphasis start-string without end-string.
145 Quotes around inline markup:
147 '*emphasis*' "*emphasis*" Straight,
148 ‘*emphasis*’ “*emphasis*” English, ...,
149 « *emphasis* » ‹ *emphasis* › « *emphasis* » ‹ *emphasis* ›
150 « *emphasis* » ‹ *emphasis* › French,
151 „*emphasis*“ ‚*emphasis*‘ »*emphasis*« ›*emphasis*‹ German, Czech, ...,
152 „*emphasis*” «*emphasis*» Romanian,
153 “*emphasis*„ ‘*emphasis*‚ Greek,
154 「*emphasis*」 『*emphasis*』traditional Chinese,
155 ”*emphasis*” ’*emphasis*’ »*emphasis*» ›*emphasis*› Swedish, Finnish,
156 „*emphasis*” ‚*emphasis*’ Polish,
157 „*emphasis*” »*emphasis*« ’*emphasis*’ Hungarian,
160 <document source="test data">
162 Quotes around inline markup:
181 \u202f\xbb \u2039\u202f
184 \u202f\u203a \xab\xa0
194 \u2005\xbb \u2039\u2005
210 \u2039 German, Czech, ...,
231 \u300ftraditional Chinese,
244 \u203a Swedish, Finnish,
264 Emphasized asterisk: *\**
266 Emphasized double asterisk: *\***
269 <document source="test data">
271 Emphasized asterisk: \n\
275 Emphasized double asterisk: \n\
286 <document source="test data">
292 l'**strong** and l\u2019**strong** with apostrophe
295 <document source="test data">
306 quoted '**strong**', quoted "**strong**",
307 quoted \u2018**strong**\u2019, quoted \u201c**strong**\u201d,
308 quoted \xab**strong**\xbb
311 <document source="test data">
323 \u2019, quoted \u201c
333 (**strong**) but not (**) or '(** ' or x**2 or \**kwargs or **
335 (however, '**kwargs' will trigger a warning and may be problematic)
338 <document source="test data">
343 ) but not (**) or '(** ' or x**2 or **kwargs or **
346 <problematic ids="id2" refid="id1">
348 kwargs' will trigger a warning and may be problematic)
349 <system_message backrefs="id2" ids="id1" level="2" line="4" source="test data" type="WARNING">
351 Inline strong start-string without end-string.
354 Strong asterisk: *****
356 Strong double asterisk: ******
359 <document source="test data">
365 Strong double asterisk: \n\
370 **strong without closing asterisks
373 <document source="test data">
375 <problematic ids="id2" refid="id1">
377 strong without closing asterisks
378 <system_message backrefs="id2" ids="id1" level="2" line="1" source="test data" type="WARNING">
380 Inline strong start-string without end-string.
384 totest
['literal'] = [
389 <document source="test data">
398 <document source="test data">
407 <document source="test data">
416 <document source="test data">
422 l'``literal`` and l\u2019``literal`` with apostrophe
425 <document source="test data">
436 quoted '``literal``', quoted "``literal``",
437 quoted \u2018``literal``\u2019, quoted \u201c``literal``\u201d,
438 quoted \xab``literal``\xbb
441 <document source="test data">
453 \u2019, quoted \u201c
463 ``'literal'`` with quotes, ``"literal"`` with quotes,
464 ``\u2018literal\u2019`` with quotes, ``\u201cliteral\u201d`` with quotes,
465 ``\xabliteral\xbb`` with quotes
468 <document source="test data">
487 ``literal ``TeX quotes'' & \backslash`` but not "``" or ``
489 (however, ``standalone TeX quotes'' will trigger a warning
490 and may be problematic)
493 <document source="test data">
496 literal ``TeX quotes'' & \\backslash
500 <problematic ids="id2" refid="id1">
502 standalone TeX quotes'' will trigger a warning
503 and may be problematic)
504 <system_message backrefs="id2" ids="id1" level="2" line="4" source="test data" type="WARNING">
506 Inline literal start-string without end-string.
509 Find the ```interpreted text``` in this paragraph!
512 <document source="test data">
520 ``literal without closing backquotes
523 <document source="test data">
525 <problematic ids="id2" refid="id1">
527 literal without closing backquotes
528 <system_message backrefs="id2" ids="id1" level="2" line="1" source="test data" type="WARNING">
530 Inline literal start-string without end-string.
533 Python ``list``\s use square bracket syntax.
536 <document source="test data">
541 s use square bracket syntax.
545 totest
['references'] = [
550 <document source="test data">
552 <reference name="ref" refname="ref">
556 l'ref_ and l\u2019ref_ with apostrophe
559 <document source="test data">
562 <reference name="ref" refname="ref">
565 <reference name="ref" refname="ref">
570 quoted 'ref_', quoted "ref_",
571 quoted \u2018ref_\u2019, quoted \u201cref_\u201d,
573 but not 'ref ref'_, "ref ref"_, \u2018ref ref\u2019_,
574 \u201cref ref\u201d_, or \xabref ref\xbb_
577 <document source="test data">
580 <reference name="ref" refname="ref">
583 <reference name="ref" refname="ref">
587 <reference name="ref" refname="ref">
589 \u2019, quoted \u201c
590 <reference name="ref" refname="ref">
594 <reference name="ref" refname="ref">
597 but not 'ref ref'_, "ref ref"_, \u2018ref ref\u2019_,
598 \u201cref ref\u201d_, or \xabref ref\xbb_
604 <document source="test data">
606 <reference anonymous="1" name="ref">
610 l'ref__ and l\u2019ref__ with apostrophe
613 <document source="test data">
616 <reference anonymous="1" name="ref">
619 <reference anonymous="1" name="ref">
624 quoted 'ref__', quoted "ref__",
625 quoted \u2018ref__\u2019, quoted \u201cref__\u201d,
626 quoted \xabref__\xbb,
627 but not 'ref ref'__, "ref ref"__, \u2018ref ref\u2019__,
628 \u201cref ref\u201d__, or \xabref ref\xbb__
631 <document source="test data">
634 <reference anonymous="1" name="ref">
637 <reference anonymous="1" name="ref">
641 <reference anonymous="1" name="ref">
643 \u2019, quoted \u201c
644 <reference anonymous="1" name="ref">
648 <reference anonymous="1" name="ref">
651 but not 'ref ref'__, "ref ref"__, \u2018ref ref\u2019__,
652 \u201cref ref\u201d__, or \xabref ref\xbb__
655 ref_, r_, r_e-f_, -ref_, and anonymousref__,
656 but not _ref_ or __attr__ or object.__attr__
659 <document source="test data">
661 <reference name="ref" refname="ref">
664 <reference name="r" refname="r">
667 <reference name="r_e-f" refname="r_e-f">
670 <reference name="ref" refname="ref">
673 <reference anonymous="1" name="anonymousref">
676 but not _ref_ or __attr__ or object.__attr__
680 totest
['phrase_references'] = [
685 <document source="test data">
687 <reference name="phrase reference" refname="phrase reference">
691 l'`phrase reference`_ and l\u2019`phrase reference`_ with apostrophe
694 <document source="test data">
697 <reference name="phrase reference" refname="phrase reference">
700 <reference name="phrase reference" refname="phrase reference">
705 quoted '`phrase reference`_', quoted "`phrase reference`_",
706 quoted \u2018`phrase reference`_\u2019,
707 quoted \u201c`phrase reference`_\u201d,
708 quoted \xab`phrase reference`_\xbb
711 <document source="test data">
714 <reference name="phrase reference" refname="phrase reference">
717 <reference name="phrase reference" refname="phrase reference">
721 <reference name="phrase reference" refname="phrase reference">
725 <reference name="phrase reference" refname="phrase reference">
729 <reference name="phrase reference" refname="phrase reference">
734 `'phrase reference'`_ with quotes, `"phrase reference"`_ with quotes,
735 `\u2018phrase reference\u2019`_ with quotes,
736 `\u201cphrase reference\u201d`_ with quotes,
737 `\xabphrase reference\xbb`_ with quotes
740 <document source="test data">
742 <reference name="'phrase reference'" refname="'phrase reference'">
745 <reference name=""phrase reference"" refname=""phrase reference"">
748 <reference name="\u2018phrase reference\u2019" refname="\u2018phrase reference\u2019">
749 \u2018phrase reference\u2019
751 <reference name="\u201cphrase reference\u201d" refname="\u201cphrase reference\u201d">
752 \u201cphrase reference\u201d
754 <reference name="\xabphrase reference\xbb" refname="\xabphrase reference\xbb">
755 \xabphrase reference\xbb
759 `anonymous reference`__
762 <document source="test data">
764 <reference anonymous="1" name="anonymous reference">
768 l'`anonymous reference`__ and l\u2019`anonymous reference`__ with apostrophe
771 <document source="test data">
774 <reference anonymous="1" name="anonymous reference">
777 <reference anonymous="1" name="anonymous reference">
782 quoted '`anonymous reference`__', quoted "`anonymous reference`__",
783 quoted \u2018`anonymous reference`__\u2019,
784 quoted \u201c`anonymous reference`__\u201d,
785 quoted \xab`anonymous reference`__\xbb
788 <document source="test data">
791 <reference anonymous="1" name="anonymous reference">
794 <reference anonymous="1" name="anonymous reference">
798 <reference anonymous="1" name="anonymous reference">
802 <reference anonymous="1" name="anonymous reference">
806 <reference anonymous="1" name="anonymous reference">
811 `'anonymous reference'`__ with quotes, `"anonymous reference"`__ with quotes,
812 `\u2018anonymous reference\u2019`__ with quotes,
813 `\u201canonymous reference\u201d`__ with quotes,
814 `\xabanonymous reference\xbb`__ with quotes
817 <document source="test data">
819 <reference anonymous="1" name="'anonymous reference'">
820 'anonymous reference'
822 <reference anonymous="1" name=""anonymous reference"">
823 "anonymous reference"
825 <reference anonymous="1" name="\u2018anonymous reference\u2019">
826 \u2018anonymous reference\u2019
828 <reference anonymous="1" name="\u201canonymous reference\u201d">
829 \u201canonymous reference\u201d
831 <reference anonymous="1" name="\xabanonymous reference\xbb">
832 \xabanonymous reference\xbb
840 <document source="test data">
842 <reference name="phrase reference across lines" refname="phrase reference across lines">
847 `phrase\`_ reference`_
850 <document source="test data">
852 <reference name="phrase`_ reference" refname="phrase`_ reference">
856 Invalid phrase reference:
858 :role:`phrase reference`_
861 <document source="test data">
863 Invalid phrase reference:
865 <problematic ids="id2" refid="id1">
866 :role:`phrase reference`_
867 <system_message backrefs="id2" ids="id1" level="2" line="3" source="test data" type="WARNING">
869 Mismatch: both interpreted text role prefix and reference suffix.
872 Invalid phrase reference:
874 `phrase reference`:role:_
877 <document source="test data">
879 Invalid phrase reference:
881 <problematic ids="id2" refid="id1">
882 `phrase reference`:role:_
883 <system_message backrefs="id2" ids="id1" level="2" line="3" source="test data" type="WARNING">
885 Mismatch: both interpreted text role suffix and reference suffix.
888 `phrase reference_ without closing backquote
891 <document source="test data">
893 <problematic ids="id2" refid="id1">
896 <reference name="reference" refname="reference">
898 without closing backquote
899 <system_message backrefs="id2" ids="id1" level="2" line="1" source="test data" type="WARNING">
901 Inline interpreted text or phrase reference start-string without end-string.
904 `anonymous phrase reference__ without closing backquote
907 <document source="test data">
909 <problematic ids="id2" refid="id1">
912 <reference anonymous="1" name="reference">
914 without closing backquote
915 <system_message backrefs="id2" ids="id1" level="2" line="1" source="test data" type="WARNING">
917 Inline interpreted text or phrase reference start-string without end-string.
921 totest
['embedded_URIs'] = [
923 `phrase reference <http://example.com>`_
926 <document source="test data">
928 <reference name="phrase reference" refuri="http://example.com">
930 <target ids="phrase-reference" names="phrase\ reference" refuri="http://example.com">
933 `anonymous reference <http://example.com>`__
936 <document source="test data">
938 <reference name="anonymous reference" refuri="http://example.com">
942 `embedded URI on next line
943 <http://example.com>`__
946 <document source="test data">
948 <reference name="embedded URI on next line" refuri="http://example.com">
949 embedded URI on next line
952 `embedded URI across lines <http://example.com/
956 <document source="test data">
958 <reference name="embedded URI across lines" refuri="http://example.com/long/path">
959 embedded URI across lines
962 `embedded URI with whitespace <http://example.com/
963 long/path /and /whitespace>`__
966 <document source="test data">
968 <reference name="embedded URI with whitespace" refuri="http://example.com/long/path/and/whitespace">
969 embedded URI with whitespace
972 `embedded email address <jdoe@example.com>`__
974 `embedded email address broken across lines <jdoe
978 <document source="test data">
980 <reference name="embedded email address" refuri="mailto:jdoe@example.com">
981 embedded email address
983 <reference name="embedded email address broken across lines" refuri="mailto:jdoe@example.com">
984 embedded email address broken across lines
987 `embedded URI with too much whitespace < http://example.com/
988 long/path /and /whitespace >`__
990 `embedded URI with too much whitespace at end <http://example.com/
991 long/path /and /whitespace >`__
993 `embedded URI with no preceding whitespace<http://example.com>`__
995 `escaped URI \<http://example.com>`__
997 See `HTML Anchors: \<a>`_.
1000 <document source="test data">
1002 <reference anonymous="1" name="embedded URI with too much whitespace < http://example.com/ long/path /and /whitespace >">
1003 embedded URI with too much whitespace < http://example.com/
1004 long/path /and /whitespace >
1006 <reference anonymous="1" name="embedded URI with too much whitespace at end <http://example.com/ long/path /and /whitespace >">
1007 embedded URI with too much whitespace at end <http://example.com/
1008 long/path /and /whitespace >
1010 <reference anonymous="1" name="embedded URI with no preceding whitespace<http://example.com>">
1011 embedded URI with no preceding whitespace<http://example.com>
1013 <reference anonymous="1" name="escaped URI <http://example.com>">
1014 escaped URI <http://example.com>
1017 <reference name="HTML Anchors: <a>" refname="html anchors: <a>">
1022 Relative URIs' reference text can be omitted:
1029 <document source="test data">
1031 Relative URIs' reference text can be omitted:
1033 <reference name="reference" refuri="reference">
1035 <target ids="reference" names="reference" refuri="reference">
1037 <reference name="anonymous" refuri="anonymous">
1042 totest
['inline_targets'] = [
1046 Here is _`another target` in some text. And _`yet
1047 another target`, spanning lines.
1049 _`Here is a TaRgeT` with case and spacial difficulties.
1052 <document source="test data">
1054 <target ids="target" names="target">
1058 <target ids="another-target" names="another\ target">
1060 in some text. And \n\
1061 <target ids="yet-another-target" names="yet\ another\ target">
1066 <target ids="here-is-a-target" names="here\ is\ a\ target">
1068 with case and spacial difficulties.
1071 l'_`target1` and l\u2019_`target2` with apostrophe
1074 <document source="test data">
1077 <target ids="target1" names="target1">
1080 <target ids="target2" names="target2">
1085 quoted '_`target1`', quoted "_`target2`",
1086 quoted \u2018_`target3`\u2019, quoted \u201c_`target4`\u201d,
1087 quoted \xab_`target5`\xbb
1090 <document source="test data">
1093 <target ids="target1" names="target1">
1096 <target ids="target2" names="target2">
1100 <target ids="target3" names="target3">
1102 \u2019, quoted \u201c
1103 <target ids="target4" names="target4">
1107 <target ids="target5" names="target5">
1112 _`'target1'` with quotes, _`"target2"` with quotes,
1113 _`\u2018target3\u2019` with quotes, _`\u201ctarget4\u201d` with quotes,
1114 _`\xabtarget5\xbb` with quotes
1117 <document source="test data">
1119 <target ids="target1" names="'target1'">
1122 <target ids="target2" names=""target2"">
1125 <target ids="target3" names="\u2018target3\u2019">
1128 <target ids="target4" names="\u201ctarget4\u201d">
1131 <target ids="target5" names="\xabtarget5\xbb">
1136 But this isn't a _target; targets require backquotes.
1138 And _`this`_ is just plain confusing.
1141 <document source="test data">
1143 But this isn't a _target; targets require backquotes.
1146 <problematic ids="id2" refid="id1">
1148 this`_ is just plain confusing.
1149 <system_message backrefs="id2" ids="id1" level="2" line="3" source="test data" type="WARNING">
1151 Inline target start-string without end-string.
1154 _`inline target without closing backquote
1157 <document source="test data">
1159 <problematic ids="id2" refid="id1">
1161 inline target without closing backquote
1162 <system_message backrefs="id2" ids="id1" level="2" line="1" source="test data" type="WARNING">
1164 Inline target start-string without end-string.
1168 totest
['footnote_reference'] = [
1173 <document source="test data">
1175 <footnote_reference ids="id1" refname="1">
1182 <document source="test data">
1184 <footnote_reference auto="1" ids="id1">
1190 <document source="test data">
1192 <footnote_reference auto="1" ids="id1" refname="label">
1198 <document source="test data">
1200 <footnote_reference auto="*" ids="id1">
1203 Adjacent footnote refs are not possible: [*]_[#label]_ [#]_[2]_ [1]_[*]_
1206 <document source="test data">
1208 Adjacent footnote refs are not possible: [*]_[#label]_ [#]_[2]_ [1]_[*]_
1212 totest
['citation_reference'] = [
1217 <document source="test data">
1219 <citation_reference ids="id1" refname="citation">
1223 [citation]_ and [cit-ation]_ and [cit.ation]_ and [CIT1]_ but not [CIT 1]_
1226 <document source="test data">
1228 <citation_reference ids="id1" refname="citation">
1231 <citation_reference ids="id2" refname="cit-ation">
1234 <citation_reference ids="id3" refname="cit.ation">
1237 <citation_reference ids="id4" refname="cit1">
1242 Adjacent citation refs are not possible: [citation]_[CIT1]_
1245 <document source="test data">
1247 Adjacent citation refs are not possible: [citation]_[CIT1]_
1251 totest
['substitution_references'] = [
1256 <document source="test data">
1258 <substitution_reference refname="subref">
1262 |subref|_ and |subref|__
1265 <document source="test data">
1267 <reference refname="subref">
1268 <substitution_reference refname="subref">
1271 <reference anonymous="1">
1272 <substitution_reference refname="subref">
1276 |substitution reference|
1279 <document source="test data">
1281 <substitution_reference refname="substitution reference">
1282 substitution reference
1289 <document source="test data">
1291 <substitution_reference refname="substitution reference">
1296 |substitution reference without closing verbar
1299 <document source="test data">
1301 <problematic ids="id2" refid="id1">
1303 substitution reference without closing verbar
1304 <system_message backrefs="id2" ids="id1" level="2" line="1" source="test data" type="WARNING">
1306 Inline substitution_reference start-string without end-string.
1309 first | then || and finally |||
1312 <document source="test data">
1314 first | then || and finally |||
1318 totest
['standalone_hyperlink'] = [
1320 http://www.standalone.hyperlink.com
1322 http:/one-slash-only.absolute.path
1324 [http://example.com]
1326 (http://example.com)
1328 <http://example.com>
1330 http://[1080:0:0:0:8:800:200C:417A]/IPv6address.html
1332 http://[3ffe:2a00:100:7031::1] (the final "]" is ambiguous in text)
1334 http://[3ffe:2a00:100:7031::1]/
1336 mailto:someone@somewhere.com
1338 news:comp.lang.python
1340 An email address in a sentence: someone@somewhere.com.
1342 ftp://ends.with.a.period.
1344 (a.question.mark@end?)
1347 <document source="test data">
1349 <reference refuri="http://www.standalone.hyperlink.com">
1350 http://www.standalone.hyperlink.com
1352 <reference refuri="http:/one-slash-only.absolute.path">
1353 http:/one-slash-only.absolute.path
1356 <reference refuri="http://example.com">
1361 <reference refuri="http://example.com">
1366 <reference refuri="http://example.com">
1370 <reference refuri="http://[1080:0:0:0:8:800:200C:417A]/IPv6address.html">
1371 http://[1080:0:0:0:8:800:200C:417A]/IPv6address.html
1373 <reference refuri="http://[3ffe:2a00:100:7031::1">
1374 http://[3ffe:2a00:100:7031::1
1375 ] (the final "]" is ambiguous in text)
1377 <reference refuri="http://[3ffe:2a00:100:7031::1]/">
1378 http://[3ffe:2a00:100:7031::1]/
1380 <reference refuri="mailto:someone@somewhere.com">
1381 mailto:someone@somewhere.com
1383 <reference refuri="news:comp.lang.python">
1384 news:comp.lang.python
1386 An email address in a sentence: \n\
1387 <reference refuri="mailto:someone@somewhere.com">
1388 someone@somewhere.com
1391 <reference refuri="ftp://ends.with.a.period">
1392 ftp://ends.with.a.period
1396 <reference refuri="mailto:a.question.mark@end">
1401 Valid URLs with escaped markup characters:
1403 http://example.com/\*content\*/whatever
1405 http://example.com/\*content*/whatever
1408 <document source="test data">
1410 Valid URLs with escaped markup characters:
1412 <reference refuri="http://example.com/*content*/whatever">
1413 http://example.com/*content*/whatever
1415 <reference refuri="http://example.com/*content*/whatever">
1416 http://example.com/*content*/whatever
1419 Valid URLs may end with punctuation inside "<>":
1421 <http://example.org/ends-with-dot.>
1424 <document source="test data">
1426 Valid URLs may end with punctuation inside "<>":
1429 <reference refuri="http://example.org/ends-with-dot.">
1430 http://example.org/ends-with-dot.
1434 Valid URLs with interesting endings:
1436 http://example.org/ends-with-pluses++
1439 <document source="test data">
1441 Valid URLs with interesting endings:
1443 <reference refuri="http://example.org/ends-with-pluses++">
1444 http://example.org/ends-with-pluses++
1447 None of these are standalone hyperlinks (their "schemes"
1448 are not recognized): signal:noise, a:b.
1451 <document source="test data">
1453 None of these are standalone hyperlinks (their "schemes"
1454 are not recognized): signal:noise, a:b.
1457 Escaped email addresses are not recognized: test\@example.org
1460 <document source="test data">
1462 Escaped email addresses are not recognized: test@example.org
1466 totest
['markup recognition rules'] = [
1468 __This__ should be left alone.
1471 <document source="test data">
1473 __This__ should be left alone.
1476 Character-level m\ *a*\ **r**\ ``k``\ `u`:title:\p
1477 with backslash-escaped whitespace, including new\
1481 <document source="test data">
1493 with backslash-escaped whitespace, including newlines.
1496 text-*separated*\u2010*by*\u2011*various*\u2012*dashes*\u2013*and*\u2014*hyphens*.
1497 \u00bf*punctuation*? \u00a1*examples*!\u00a0*\u00a0no-break-space\u00a0*.
1500 <document source="test data">
1529 \u00a0no-break-space\u00a0
1532 # Whitespace characters:
1533 # \u180e*MONGOLIAN VOWEL SEPARATOR*\u180e, fails in Python 2.4
1537 or *space* or one of
1538 \xa0*NO-BREAK SPACE*\xa0,
1539 \u1680*OGHAM SPACE MARK*\u1680,
1540 \u2000*EN QUAD*\u2000,
1541 \u2001*EM QUAD*\u2001,
1542 \u2002*EN SPACE*\u2002,
1543 \u2003*EM SPACE*\u2003,
1544 \u2004*THREE-PER-EM SPACE*\u2004,
1545 \u2005*FOUR-PER-EM SPACE*\u2005,
1546 \u2006*SIX-PER-EM SPACE*\u2006,
1547 \u2007*FIGURE SPACE*\u2007,
1548 \u2008*PUNCTUATION SPACE*\u2008,
1549 \u2009*THIN SPACE*\u2009,
1550 \u200a*HAIR SPACE*\u200a,
1551 \u202f*NARROW NO-BREAK SPACE*\u202f,
1552 \u205f*MEDIUM MATHEMATICAL SPACE*\u205f,
1553 \u3000*IDEOGRAPHIC SPACE*\u3000,
1554 \u2028*LINE SEPARATOR*\u2028
1557 <document source="test data">
1621 NARROW NO-BREAK SPACE
1625 MEDIUM MATHEMATICAL SPACE
1635 # « * » ‹ * › « * » ‹ * › « * » ‹ * › French,
1637 "Quoted" markup start-string (matched openers & closers) -> no markup:
1639 '*' "*" (*) <*> [*] {*}
1642 Some international quoting styles:
1643 ‘*’ “*” English, ...,
1644 „*“ ‚*‘ »*« ›*‹ German, Czech, ...,
1647 「*」 『*』traditional Chinese,
1648 ”*” ’*’ »*» ›*› Swedish, Finnish,
1650 „*” »*« ’*’ Hungarian,
1652 But this is „*’ emphasized »*‹.
1655 <document source="test data">
1657 "Quoted" markup start-string (matched openers & closers) -> no markup:
1659 '*' "*" (*) <*> [*] {*}
1662 Some international quoting styles:
1663 ‘*’ “*” English, ...,
1664 „*“ ‚*‘ »*« ›*‹ German, Czech, ...,
1667 「*」 『*』traditional Chinese,
1668 ”*” ’*’ »*» ›*› Swedish, Finnish,
1670 „*” »*« ’*’ Hungarian,
1680 if __name__
== '__main__':
1682 unittest
.main(defaultTest
='suite')