| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
""" |
| 8 |
Tests for docutils.transforms.references.Footnotes. |
| 9 |
""" |
| 10 |
|
| 11 |
from pathlib import Path |
| 12 |
import sys |
| 13 |
import unittest |
| 14 |
|
| 15 |
if __name__ == '__main__': |
| 16 |
|
| 17 |
|
| 18 |
sys.path.insert(0, str(Path(__file__).resolve().parents[2])) |
| 19 |
|
| 20 |
from docutils.frontend import get_default_settings |
| 21 |
from docutils.parsers.rst import Parser |
| 22 |
from docutils.transforms.references import Footnotes |
| 23 |
from docutils.transforms.universal import TestMessages |
| 24 |
from docutils.utils import new_document |
| 25 |
|
| 26 |
|
| 27 |
class TransformTestCase(unittest.TestCase): |
| 28 |
def test_transforms(self): |
| 29 |
parser = Parser() |
| 30 |
settings = get_default_settings(Parser) |
| 31 |
settings.warning_stream = '' |
| 32 |
for name, (transforms, cases) in totest.items(): |
| 33 |
for casenum, (case_input, case_expected) in enumerate(cases): |
| 34 |
with self.subTest(id=f'totest[{name!r}][{casenum}]'): |
| 35 |
document = new_document('test data', settings.copy()) |
| 36 |
parser.parse(case_input, document) |
| 37 |
|
| 38 |
|
| 39 |
document.transformer.add_transforms(transforms) |
| 40 |
document.transformer.add_transform(TestMessages) |
| 41 |
document.transformer.apply_transforms() |
| 42 |
output = document.pformat() |
| 43 |
self.assertEqual(case_expected, output) |
| 44 |
|
| 45 |
|
| 46 |
totest = {} |
| 47 |
|
| 48 |
totest['footnotes'] = ((Footnotes,), [ |
| 49 |
["""\ |
| 50 |
[#autolabel]_ |
| 51 |
|
| 52 |
.. [#autolabel] text |
| 53 |
""", |
| 54 |
"""\ |
| 55 |
<document source="test data"> |
| 56 |
<paragraph> |
| 57 |
<footnote_reference auto="1" ids="footnote-reference-1" refid="autolabel"> |
| 58 |
1 |
| 59 |
<footnote auto="1" backrefs="footnote-reference-1" ids="autolabel" names="autolabel"> |
| 60 |
<label> |
| 61 |
1 |
| 62 |
<paragraph> |
| 63 |
text |
| 64 |
"""], |
| 65 |
["""\ |
| 66 |
autonumber: [#]_ |
| 67 |
|
| 68 |
.. [#] text |
| 69 |
""", |
| 70 |
"""\ |
| 71 |
<document source="test data"> |
| 72 |
<paragraph> |
| 73 |
autonumber: \n\ |
| 74 |
<footnote_reference auto="1" ids="footnote-reference-1" refid="footnote-1"> |
| 75 |
1 |
| 76 |
<footnote auto="1" backrefs="footnote-reference-1" ids="footnote-1" names="1"> |
| 77 |
<label> |
| 78 |
1 |
| 79 |
<paragraph> |
| 80 |
text |
| 81 |
"""], |
| 82 |
["""\ |
| 83 |
[#]_ is the first auto-numbered footnote reference. |
| 84 |
[#]_ is the second auto-numbered footnote reference. |
| 85 |
|
| 86 |
.. [#] Auto-numbered footnote 1. |
| 87 |
.. [#] Auto-numbered footnote 2. |
| 88 |
.. [#] Auto-numbered footnote 3. |
| 89 |
|
| 90 |
[#]_ is the third auto-numbered footnote reference. |
| 91 |
""", |
| 92 |
"""\ |
| 93 |
<document source="test data"> |
| 94 |
<paragraph> |
| 95 |
<footnote_reference auto="1" ids="footnote-reference-1" refid="footnote-1"> |
| 96 |
1 |
| 97 |
is the first auto-numbered footnote reference. |
| 98 |
<footnote_reference auto="1" ids="footnote-reference-2" refid="footnote-2"> |
| 99 |
2 |
| 100 |
is the second auto-numbered footnote reference. |
| 101 |
<footnote auto="1" backrefs="footnote-reference-1" ids="footnote-1" names="1"> |
| 102 |
<label> |
| 103 |
1 |
| 104 |
<paragraph> |
| 105 |
Auto-numbered footnote 1. |
| 106 |
<footnote auto="1" backrefs="footnote-reference-2" ids="footnote-2" names="2"> |
| 107 |
<label> |
| 108 |
2 |
| 109 |
<paragraph> |
| 110 |
Auto-numbered footnote 2. |
| 111 |
<footnote auto="1" backrefs="footnote-reference-3" ids="footnote-3" names="3"> |
| 112 |
<label> |
| 113 |
3 |
| 114 |
<paragraph> |
| 115 |
Auto-numbered footnote 3. |
| 116 |
<paragraph> |
| 117 |
<footnote_reference auto="1" ids="footnote-reference-3" refid="footnote-3"> |
| 118 |
3 |
| 119 |
is the third auto-numbered footnote reference. |
| 120 |
"""], |
| 121 |
["""\ |
| 122 |
[#third]_ is a reference to the third auto-numbered footnote. |
| 123 |
|
| 124 |
.. [#first] First auto-numbered footnote. |
| 125 |
.. [#second] Second auto-numbered footnote. |
| 126 |
.. [#third] Third auto-numbered footnote. |
| 127 |
|
| 128 |
[#second]_ is a reference to the second auto-numbered footnote. |
| 129 |
[#first]_ is a reference to the first auto-numbered footnote. |
| 130 |
[#third]_ is another reference to the third auto-numbered footnote. |
| 131 |
|
| 132 |
Here are some internal cross-references to the implicit targets |
| 133 |
generated by the footnotes: first_, second_, third_. |
| 134 |
""", |
| 135 |
"""\ |
| 136 |
<document source="test data"> |
| 137 |
<paragraph> |
| 138 |
<footnote_reference auto="1" ids="footnote-reference-1" refid="third"> |
| 139 |
3 |
| 140 |
is a reference to the third auto-numbered footnote. |
| 141 |
<footnote auto="1" backrefs="footnote-reference-3" ids="first" names="first"> |
| 142 |
<label> |
| 143 |
1 |
| 144 |
<paragraph> |
| 145 |
First auto-numbered footnote. |
| 146 |
<footnote auto="1" backrefs="footnote-reference-2" ids="second" names="second"> |
| 147 |
<label> |
| 148 |
2 |
| 149 |
<paragraph> |
| 150 |
Second auto-numbered footnote. |
| 151 |
<footnote auto="1" backrefs="footnote-reference-1 footnote-reference-4" ids="third" names="third"> |
| 152 |
<label> |
| 153 |
3 |
| 154 |
<paragraph> |
| 155 |
Third auto-numbered footnote. |
| 156 |
<paragraph> |
| 157 |
<footnote_reference auto="1" ids="footnote-reference-2" refid="second"> |
| 158 |
2 |
| 159 |
is a reference to the second auto-numbered footnote. |
| 160 |
<footnote_reference auto="1" ids="footnote-reference-3" refid="first"> |
| 161 |
1 |
| 162 |
is a reference to the first auto-numbered footnote. |
| 163 |
<footnote_reference auto="1" ids="footnote-reference-4" refid="third"> |
| 164 |
3 |
| 165 |
is another reference to the third auto-numbered footnote. |
| 166 |
<paragraph> |
| 167 |
Here are some internal cross-references to the implicit targets |
| 168 |
generated by the footnotes: \n\ |
| 169 |
<reference name="first" refname="first"> |
| 170 |
first |
| 171 |
, \n\ |
| 172 |
<reference name="second" refname="second"> |
| 173 |
second |
| 174 |
, \n\ |
| 175 |
<reference name="third" refname="third"> |
| 176 |
third |
| 177 |
. |
| 178 |
"""], |
| 179 |
["""\ |
| 180 |
Mixed anonymous and labelled auto-numbered footnotes: |
| 181 |
|
| 182 |
[#four]_ should be 4, [#]_ should be 1, |
| 183 |
[#]_ should be 3, [#]_ is one too many, |
| 184 |
[#two]_ should be 2, and [#six]_ doesn't exist. |
| 185 |
|
| 186 |
.. [#] Auto-numbered footnote 1. |
| 187 |
.. [#two] Auto-numbered footnote 2. |
| 188 |
.. [#] Auto-numbered footnote 3. |
| 189 |
.. [#four] Auto-numbered footnote 4. |
| 190 |
.. [#five] Auto-numbered footnote 5. |
| 191 |
.. [#five] Auto-numbered footnote 5 again (duplicate). |
| 192 |
""", |
| 193 |
"""\ |
| 194 |
<document source="test data"> |
| 195 |
<paragraph> |
| 196 |
Mixed anonymous and labelled auto-numbered footnotes: |
| 197 |
<paragraph> |
| 198 |
<footnote_reference auto="1" ids="footnote-reference-1" refid="four"> |
| 199 |
4 |
| 200 |
should be 4, \n\ |
| 201 |
<footnote_reference auto="1" ids="footnote-reference-2" refid="footnote-1"> |
| 202 |
1 |
| 203 |
should be 1, |
| 204 |
<footnote_reference auto="1" ids="footnote-reference-3" refid="footnote-2"> |
| 205 |
3 |
| 206 |
should be 3, \n\ |
| 207 |
<problematic ids="problematic-1 footnote-reference-4" refid="system-message-1"> |
| 208 |
[#]_ |
| 209 |
is one too many, |
| 210 |
<footnote_reference auto="1" ids="footnote-reference-5" refid="two"> |
| 211 |
2 |
| 212 |
should be 2, and \n\ |
| 213 |
<footnote_reference auto="1" ids="footnote-reference-6" refname="six"> |
| 214 |
doesn't exist. |
| 215 |
<footnote auto="1" backrefs="footnote-reference-2" ids="footnote-1" names="1"> |
| 216 |
<label> |
| 217 |
1 |
| 218 |
<paragraph> |
| 219 |
Auto-numbered footnote 1. |
| 220 |
<footnote auto="1" backrefs="footnote-reference-5" ids="two" names="two"> |
| 221 |
<label> |
| 222 |
2 |
| 223 |
<paragraph> |
| 224 |
Auto-numbered footnote 2. |
| 225 |
<footnote auto="1" backrefs="footnote-reference-3" ids="footnote-2" names="3"> |
| 226 |
<label> |
| 227 |
3 |
| 228 |
<paragraph> |
| 229 |
Auto-numbered footnote 3. |
| 230 |
<footnote auto="1" backrefs="footnote-reference-1" ids="four" names="four"> |
| 231 |
<label> |
| 232 |
4 |
| 233 |
<paragraph> |
| 234 |
Auto-numbered footnote 4. |
| 235 |
<footnote auto="1" dupnames="five" ids="five"> |
| 236 |
<label> |
| 237 |
5 |
| 238 |
<paragraph> |
| 239 |
Auto-numbered footnote 5. |
| 240 |
<footnote auto="1" dupnames="five" ids="five-1"> |
| 241 |
<label> |
| 242 |
6 |
| 243 |
<system_message backrefs="five-1" level="2" line="12" source="test data" type="WARNING"> |
| 244 |
<paragraph> |
| 245 |
Duplicate explicit target name: "five". |
| 246 |
<paragraph> |
| 247 |
Auto-numbered footnote 5 again (duplicate). |
| 248 |
<system_message backrefs="problematic-1" ids="system-message-1" level="3" line="3" source="test data" type="ERROR"> |
| 249 |
<paragraph> |
| 250 |
Too many autonumbered footnote references: only 2 corresponding footnotes available. |
| 251 |
"""], |
| 252 |
["""\ |
| 253 |
Mixed auto-numbered and manual footnotes: |
| 254 |
|
| 255 |
.. [1] manually numbered |
| 256 |
.. [#] auto-numbered |
| 257 |
.. [#label] autonumber-labeled |
| 258 |
""", |
| 259 |
"""\ |
| 260 |
<document source="test data"> |
| 261 |
<paragraph> |
| 262 |
Mixed auto-numbered and manual footnotes: |
| 263 |
<footnote ids="footnote-1" names="1"> |
| 264 |
<label> |
| 265 |
1 |
| 266 |
<paragraph> |
| 267 |
manually numbered |
| 268 |
<footnote auto="1" ids="footnote-2" names="2"> |
| 269 |
<label> |
| 270 |
2 |
| 271 |
<paragraph> |
| 272 |
auto-numbered |
| 273 |
<footnote auto="1" ids="label" names="label"> |
| 274 |
<label> |
| 275 |
3 |
| 276 |
<paragraph> |
| 277 |
autonumber-labeled |
| 278 |
"""], |
| 279 |
["""\ |
| 280 |
A labeled autonumbered footnote referece: [#footnote]_. |
| 281 |
|
| 282 |
An unlabeled autonumbered footnote referece: [#]_. |
| 283 |
|
| 284 |
.. [#] Unlabeled autonumbered footnote. |
| 285 |
.. [#footnote] Labeled autonumbered footnote. |
| 286 |
Note that the footnotes are not in the same |
| 287 |
order as the references. |
| 288 |
""", |
| 289 |
"""\ |
| 290 |
<document source="test data"> |
| 291 |
<paragraph> |
| 292 |
A labeled autonumbered footnote referece: \n\ |
| 293 |
<footnote_reference auto="1" ids="footnote-reference-1" refid="footnote"> |
| 294 |
2 |
| 295 |
. |
| 296 |
<paragraph> |
| 297 |
An unlabeled autonumbered footnote referece: \n\ |
| 298 |
<footnote_reference auto="1" ids="footnote-reference-2" refid="footnote-1"> |
| 299 |
1 |
| 300 |
. |
| 301 |
<footnote auto="1" backrefs="footnote-reference-2" ids="footnote-1" names="1"> |
| 302 |
<label> |
| 303 |
1 |
| 304 |
<paragraph> |
| 305 |
Unlabeled autonumbered footnote. |
| 306 |
<footnote auto="1" backrefs="footnote-reference-1" ids="footnote" names="footnote"> |
| 307 |
<label> |
| 308 |
2 |
| 309 |
<paragraph> |
| 310 |
Labeled autonumbered footnote. |
| 311 |
Note that the footnotes are not in the same |
| 312 |
order as the references. |
| 313 |
"""], |
| 314 |
["""\ |
| 315 |
Mixed manually-numbered, anonymous auto-numbered, |
| 316 |
and labelled auto-numbered footnotes: |
| 317 |
|
| 318 |
[#four]_ should be 4, [#]_ should be 2, |
| 319 |
[1]_ is 1, [3]_ is 3, |
| 320 |
[#]_ should be 6, [#]_ is one too many, |
| 321 |
[#five]_ should be 5, and [#eight]_ doesn't exist. |
| 322 |
|
| 323 |
.. [1] Manually-numbered footnote 1. |
| 324 |
.. [#] Auto-numbered footnote 2. |
| 325 |
.. [#four] Auto-numbered footnote 4. |
| 326 |
.. [3] Manually-numbered footnote 3 |
| 327 |
.. [#five] Auto-numbered footnote 5. |
| 328 |
.. [#] Auto-numbered footnote 6. |
| 329 |
.. [#five] Auto-numbered footnote 5 again (duplicate). |
| 330 |
""", |
| 331 |
"""\ |
| 332 |
<document source="test data"> |
| 333 |
<paragraph> |
| 334 |
Mixed manually-numbered, anonymous auto-numbered, |
| 335 |
and labelled auto-numbered footnotes: |
| 336 |
<paragraph> |
| 337 |
<footnote_reference auto="1" ids="footnote-reference-1" refid="four"> |
| 338 |
4 |
| 339 |
should be 4, \n\ |
| 340 |
<footnote_reference auto="1" ids="footnote-reference-2" refid="footnote-2"> |
| 341 |
2 |
| 342 |
should be 2, |
| 343 |
<footnote_reference ids="footnote-reference-3" refid="footnote-1"> |
| 344 |
1 |
| 345 |
is 1, \n\ |
| 346 |
<footnote_reference ids="footnote-reference-4" refid="footnote-3"> |
| 347 |
3 |
| 348 |
is 3, |
| 349 |
<footnote_reference auto="1" ids="footnote-reference-5" refid="footnote-4"> |
| 350 |
6 |
| 351 |
should be 6, \n\ |
| 352 |
<problematic ids="problematic-1 footnote-reference-6" refid="system-message-1"> |
| 353 |
[#]_ |
| 354 |
is one too many, |
| 355 |
<footnote_reference auto="1" ids="footnote-reference-7" refname="five"> |
| 356 |
should be 5, and \n\ |
| 357 |
<footnote_reference auto="1" ids="footnote-reference-8" refname="eight"> |
| 358 |
doesn't exist. |
| 359 |
<footnote backrefs="footnote-reference-3" ids="footnote-1" names="1"> |
| 360 |
<label> |
| 361 |
1 |
| 362 |
<paragraph> |
| 363 |
Manually-numbered footnote 1. |
| 364 |
<footnote auto="1" backrefs="footnote-reference-2" ids="footnote-2" names="2"> |
| 365 |
<label> |
| 366 |
2 |
| 367 |
<paragraph> |
| 368 |
Auto-numbered footnote 2. |
| 369 |
<footnote auto="1" backrefs="footnote-reference-1" ids="four" names="four"> |
| 370 |
<label> |
| 371 |
4 |
| 372 |
<paragraph> |
| 373 |
Auto-numbered footnote 4. |
| 374 |
<footnote backrefs="footnote-reference-4" ids="footnote-3" names="3"> |
| 375 |
<label> |
| 376 |
3 |
| 377 |
<paragraph> |
| 378 |
Manually-numbered footnote 3 |
| 379 |
<footnote auto="1" dupnames="five" ids="five"> |
| 380 |
<label> |
| 381 |
5 |
| 382 |
<paragraph> |
| 383 |
Auto-numbered footnote 5. |
| 384 |
<footnote auto="1" backrefs="footnote-reference-5" ids="footnote-4" names="6"> |
| 385 |
<label> |
| 386 |
6 |
| 387 |
<paragraph> |
| 388 |
Auto-numbered footnote 6. |
| 389 |
<footnote auto="1" dupnames="five" ids="five-1"> |
| 390 |
<label> |
| 391 |
7 |
| 392 |
<system_message backrefs="five-1" level="2" line="15" source="test data" type="WARNING"> |
| 393 |
<paragraph> |
| 394 |
Duplicate explicit target name: "five". |
| 395 |
<paragraph> |
| 396 |
Auto-numbered footnote 5 again (duplicate). |
| 397 |
<system_message backrefs="problematic-1" ids="system-message-1" level="3" line="4" source="test data" type="ERROR"> |
| 398 |
<paragraph> |
| 399 |
Too many autonumbered footnote references: only 2 corresponding footnotes available. |
| 400 |
"""], |
| 401 |
["""\ |
| 402 |
Referencing a footnote by symbol [*]_. |
| 403 |
|
| 404 |
.. [*] This is an auto-symbol footnote. |
| 405 |
""", |
| 406 |
"""\ |
| 407 |
<document source="test data"> |
| 408 |
<paragraph> |
| 409 |
Referencing a footnote by symbol \n\ |
| 410 |
<footnote_reference auto="*" ids="footnote-reference-1" refid="footnote-1"> |
| 411 |
* |
| 412 |
. |
| 413 |
<footnote auto="*" backrefs="footnote-reference-1" ids="footnote-1"> |
| 414 |
<label> |
| 415 |
* |
| 416 |
<paragraph> |
| 417 |
This is an auto-symbol footnote. |
| 418 |
"""], |
| 419 |
["""\ |
| 420 |
A sequence of symbol footnote references: |
| 421 |
[*]_ [*]_ [*]_ [*]_ [*]_ [*]_ [*]_ [*]_ [*]_ [*]_ [*]_ [*]_. |
| 422 |
|
| 423 |
.. [*] Auto-symbol footnote 1. |
| 424 |
.. [*] Auto-symbol footnote 2. |
| 425 |
.. [*] Auto-symbol footnote 3. |
| 426 |
.. [*] Auto-symbol footnote 4. |
| 427 |
.. [*] Auto-symbol footnote 5. |
| 428 |
.. [*] Auto-symbol footnote 6. |
| 429 |
.. [*] Auto-symbol footnote 7. |
| 430 |
.. [*] Auto-symbol footnote 8. |
| 431 |
.. [*] Auto-symbol footnote 9. |
| 432 |
.. [*] Auto-symbol footnote 10. |
| 433 |
.. [*] Auto-symbol footnote 11. |
| 434 |
.. [*] Auto-symbol footnote 12. |
| 435 |
""", |
| 436 |
"""\ |
| 437 |
<document source="test data"> |
| 438 |
<paragraph> |
| 439 |
A sequence of symbol footnote references: |
| 440 |
<footnote_reference auto="*" ids="footnote-reference-1" refid="footnote-1"> |
| 441 |
* |
| 442 |
\n\ |
| 443 |
<footnote_reference auto="*" ids="footnote-reference-2" refid="footnote-2"> |
| 444 |
\u2020 |
| 445 |
\n\ |
| 446 |
<footnote_reference auto="*" ids="footnote-reference-3" refid="footnote-3"> |
| 447 |
\u2021 |
| 448 |
\n\ |
| 449 |
<footnote_reference auto="*" ids="footnote-reference-4" refid="footnote-4"> |
| 450 |
\u00A7 |
| 451 |
\n\ |
| 452 |
<footnote_reference auto="*" ids="footnote-reference-5" refid="footnote-5"> |
| 453 |
\u00B6 |
| 454 |
\n\ |
| 455 |
<footnote_reference auto="*" ids="footnote-reference-6" refid="footnote-6"> |
| 456 |
# |
| 457 |
\n\ |
| 458 |
<footnote_reference auto="*" ids="footnote-reference-7" refid="footnote-7"> |
| 459 |
\u2660 |
| 460 |
\n\ |
| 461 |
<footnote_reference auto="*" ids="footnote-reference-8" refid="footnote-8"> |
| 462 |
\u2665 |
| 463 |
\n\ |
| 464 |
<footnote_reference auto="*" ids="footnote-reference-9" refid="footnote-9"> |
| 465 |
\u2666 |
| 466 |
\n\ |
| 467 |
<footnote_reference auto="*" ids="footnote-reference-10" refid="footnote-10"> |
| 468 |
\u2663 |
| 469 |
\n\ |
| 470 |
<footnote_reference auto="*" ids="footnote-reference-11" refid="footnote-11"> |
| 471 |
** |
| 472 |
\n\ |
| 473 |
<footnote_reference auto="*" ids="footnote-reference-12" refid="footnote-12"> |
| 474 |
\u2020\u2020 |
| 475 |
. |
| 476 |
<footnote auto="*" backrefs="footnote-reference-1" ids="footnote-1"> |
| 477 |
<label> |
| 478 |
* |
| 479 |
<paragraph> |
| 480 |
Auto-symbol footnote 1. |
| 481 |
<footnote auto="*" backrefs="footnote-reference-2" ids="footnote-2"> |
| 482 |
<label> |
| 483 |
\u2020 |
| 484 |
<paragraph> |
| 485 |
Auto-symbol footnote 2. |
| 486 |
<footnote auto="*" backrefs="footnote-reference-3" ids="footnote-3"> |
| 487 |
<label> |
| 488 |
\u2021 |
| 489 |
<paragraph> |
| 490 |
Auto-symbol footnote 3. |
| 491 |
<footnote auto="*" backrefs="footnote-reference-4" ids="footnote-4"> |
| 492 |
<label> |
| 493 |
\u00A7 |
| 494 |
<paragraph> |
| 495 |
Auto-symbol footnote 4. |
| 496 |
<footnote auto="*" backrefs="footnote-reference-5" ids="footnote-5"> |
| 497 |
<label> |
| 498 |
\u00B6 |
| 499 |
<paragraph> |
| 500 |
Auto-symbol footnote 5. |
| 501 |
<footnote auto="*" backrefs="footnote-reference-6" ids="footnote-6"> |
| 502 |
<label> |
| 503 |
# |
| 504 |
<paragraph> |
| 505 |
Auto-symbol footnote 6. |
| 506 |
<footnote auto="*" backrefs="footnote-reference-7" ids="footnote-7"> |
| 507 |
<label> |
| 508 |
\u2660 |
| 509 |
<paragraph> |
| 510 |
Auto-symbol footnote 7. |
| 511 |
<footnote auto="*" backrefs="footnote-reference-8" ids="footnote-8"> |
| 512 |
<label> |
| 513 |
\u2665 |
| 514 |
<paragraph> |
| 515 |
Auto-symbol footnote 8. |
| 516 |
<footnote auto="*" backrefs="footnote-reference-9" ids="footnote-9"> |
| 517 |
<label> |
| 518 |
\u2666 |
| 519 |
<paragraph> |
| 520 |
Auto-symbol footnote 9. |
| 521 |
<footnote auto="*" backrefs="footnote-reference-10" ids="footnote-10"> |
| 522 |
<label> |
| 523 |
\u2663 |
| 524 |
<paragraph> |
| 525 |
Auto-symbol footnote 10. |
| 526 |
<footnote auto="*" backrefs="footnote-reference-11" ids="footnote-11"> |
| 527 |
<label> |
| 528 |
** |
| 529 |
<paragraph> |
| 530 |
Auto-symbol footnote 11. |
| 531 |
<footnote auto="*" backrefs="footnote-reference-12" ids="footnote-12"> |
| 532 |
<label> |
| 533 |
\u2020\u2020 |
| 534 |
<paragraph> |
| 535 |
Auto-symbol footnote 12. |
| 536 |
"""], |
| 537 |
["""\ |
| 538 |
Duplicate manual footnote labels: |
| 539 |
|
| 540 |
.. [1] Footnote. |
| 541 |
|
| 542 |
.. [1] Footnote. |
| 543 |
""", |
| 544 |
"""\ |
| 545 |
<document source="test data"> |
| 546 |
<paragraph> |
| 547 |
Duplicate manual footnote labels: |
| 548 |
<footnote dupnames="1" ids="footnote-1"> |
| 549 |
<label> |
| 550 |
1 |
| 551 |
<paragraph> |
| 552 |
Footnote. |
| 553 |
<footnote dupnames="1" ids="footnote-2"> |
| 554 |
<label> |
| 555 |
1 |
| 556 |
<system_message backrefs="footnote-2" level="2" line="5" source="test data" type="WARNING"> |
| 557 |
<paragraph> |
| 558 |
Duplicate explicit target name: "1". |
| 559 |
<paragraph> |
| 560 |
Footnote. |
| 561 |
"""], |
| 562 |
]) |
| 563 |
|
| 564 |
|
| 565 |
if __name__ == '__main__': |
| 566 |
unittest.main() |