summaryrefslogtreecommitdiff
path: root/test/test_transforms
Commit message (Collapse)AuthorAgeFilesLines
* Limit length of input lines and substitution expansion.milde2020-09-141-0/+71
| | | | | | | | | | | | | | | | | | Mitigate the danger of DoS attacs using specially crafted rST input (cf. bug #381). The default value of 10 000 characters should suffice for legitimate use cases (e.g. long paragraphs in auto-wrapping editors or extensive creative use of substitutions). Applications processing untrusted rST might wish to lower this limitation (together with other safety measures described in docs/howto/security.txt). Unsupervised processing of untrusted rST input should always be safeguarded with limits on processing time and memory use. git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk/docutils@8565 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Fix link to 2-Clause BSD license.milde2020-09-041-1/+1
| | | | git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk/docutils@8554 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Restore support for running tests stand-alone.milde2020-01-3119-19/+55
| | | | | | | | | After the switch to absolute imports, individual test could no longer be run in from their directory (import error). This patch makes the `pythonpath` expansion in the test subdirectories' ``__init__`` files functional again. git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk/docutils@8481 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Fix [ 383 ] Smart quotes around opening and separator characters.milde2020-01-261-13/+32
| | | | git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk/docutils@8469 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Do not rely on `nodes.Node.traverse()` returning a "list" instance.milde2019-09-061-0/+2
| | | | | | | While the current implementation actually returns a list of nodes, the docstring specifies only: "Return an iterable ...". git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk/docutils@8387 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Add test for "strip-classes" setting.milde2019-09-061-5/+5
| | | | git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk/docutils@8385 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* py3: Use 'absolute_import' futuremilde2019-08-2619-22/+44
| | | | | | | | This mostly applies to tests. Signed-off-by: Stephen Finucane <stephen@that.guru> git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk/docutils@8356 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* py3: Switch to print functionsmilde2019-08-262-6/+6
| | | | | | | | | | Remove all uses of print as a statement. This includes comments, many of which are simply removed as noise (they're in version control and can be re-added later, if necessary). Signed-off-by: Stephen Finucane <stephen@that.guru> git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk/docutils@8346 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Fix py38 SyntaxWarning: invalid escape sequence \grubert2019-08-119-90/+90
| | | | git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk/docutils@8311 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Fix #332 and #342 (smartquotes problems).milde2019-07-241-9/+116
| | | | | | | Standard backslash escape for smartquotes. No escape in roles descending from `inline literal`. git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk/docutils@8301 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Unescape null-escaped content in nodes.Text.astext().milde2019-07-221-43/+43
| | | | | | | | | | | Store the null-escaped text in the doctree nodes and unescape in nodes.Text.astext(). Enables functions and transforms processing Text nodes to respect backslash escapes. Provides backslash-escaping of the `author separator` in the "authors" docinfo field and the `classifier delimiter` in definition list terms. git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk/docutils@8284 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Revert the fix for backslash escaping in transforms.milde2018-11-211-109/+8
| | | | | | | | | Still waiting for review. Reverts last three commits from a local "feature branch" unintentionally applied to trunk with `git svn`. git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk/docutils@8235 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* smartquotes: Use single backslashes for escaping.milde2018-11-201-8/+109
| | | | | | | | Let the smartquote transform take advantage of the representation of escaping backslashes in the doctree as null characters. git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk/docutils@8234 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* DocInfo transform must not use "rawsource" attribute for escaping.milde2018-11-201-48/+48
| | | | | | | | | | | Remove implementation of escaping author-separators in bibliographic fields that relies on the "rawsource" attribute. This is not safe (rawsource is only for information and debugging purposes). A proper fix can be done with null-escaped text in the doctree. C.f. https://sourceforge.net/p/docutils/bugs/_discuss/thread/c8f86be6/74ed/attachment/null-escape-in-doctree2.patch git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk/docutils@8231 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Fix a typo.milde2018-01-141-10/+10
| | | | git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk/docutils@8210 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Add <target> to one more testcase (see r8206).milde2017-12-191-1/+1
| | | | git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk/docutils@8207 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Add tagname to "illegal element" substitution definition error message.milde2017-12-181-1/+1
| | | | | | | Be a bit more verbose when detecting nodes that are disallowed inside substitution definitions. git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk/docutils@8206 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Ignore backslash-escaped separators when extracting authors from a paragraph.milde2017-11-041-0/+43
| | | | git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk/docutils@8198 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* smartquotes: Fix bug #332.milde2017-10-251-6/+36
| | | | | | | | Use open quote after whitespace, ZWSP, and ZWNJ. Code cleanup. git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk/docutils@8190 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Add field name as class argument to generic docinfo fields unconditionally.milde2017-10-061-9/+9
| | | | | | | | | | Also add the field name, if the DocInfo tranform fails to converts a bibliographic field list into a docinfo element. This allows styling of, e.g., a "copyright" element that also contains a license as separate paragraph when suppressing the warning (cf. Bug [325]). git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk/docutils@8183 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Fix [ 320 ] Russian docinfo fields not recognized.milde2017-06-181-1/+96
| | | | git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk/docutils@8117 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Add "smartquotes-locales" setting.milde2017-05-081-0/+22
| | | | git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk/docutils@8068 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* unroll problematic refs to their origin in document when reporting errorsmilde2017-05-041-1/+1
| | | | | | | Patch by Kirill Smelkov. This is part of the (partially outdated) suite of patches on https://sourceforge.net/p/docutils/patches/67/. git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk/docutils@8067 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Fix [ 317 ] Extra space inserted with French smartquotes .milde2017-04-241-0/+66
| | | | git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk/docutils@8061 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Do not add a second ID to problematic references.milde2017-04-061-2/+2
| | | | git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk/docutils@8055 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Update smartquotes: milde2017-03-311-5/+7
| | | | | | | | | | | | | * use the rules of the `Imprimerie nationale` as french default (full NBSP inside guillemets). * do not invert “ and ’ in en-UK: expect British authors to use u0027 APOSTROPHE for primary quotes and " for secondary quotes in the source. Set ``--smart-quotes=alt`` (or use en-UK-x-altquot) for inversion by `smartquotes`. * do not call ``educate_backticks`` in the SmartQuotes transform: backticks have a special meaning in rST. git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk/docutils@8053 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Fix [ 313 ] differentiate apostrophe from single quote (if possible).milde2017-03-191-19/+31
| | | | | | Mind, that this is not possible for apostrophe at end of words. git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk/docutils@8050 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Update and add smartquote definitions for some languages.milde2017-01-171-2/+2
| | | | git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk/docutils@8017 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Test update.milde2016-05-241-0/+11
| | | | git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk/docutils@7940 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Add name of generic bibliographic fields as a "classes" attribute valuemilde2015-05-291-2/+2
| | | | git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk/docutils@7897 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Consistently use "utf-8" (not "utf8") in magic comment giving source encoding.milde2013-06-041-1/+1
| | | | | | | Fixes problems with Docutils installed in "virtualenv" https://sourceforge.net/p/docutils/patches/105/ git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk/docutils@7668 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Treat embedded standalone hyperlinks as URI, even if ending in underscore.milde2013-03-111-1/+40
| | | | git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk/docutils@7629 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Fix [ 3607029 ] traceback with embedded alias pointing to missing target.milde2013-03-071-0/+22
| | | | git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk/docutils@7624 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Support embedded aliases within hyperlink references.milde2013-02-181-0/+36
| | | | git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk/docutils@7610 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Apply [ 2714873 ] Fix for the overwritting of document attributes.milde2013-01-211-1/+35
| | | | git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk/docutils@7595 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* smartquotes: Skip emtpy text tokens without updating the last character.milde2013-01-041-2/+14
| | | | git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk/docutils@7585 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* SmartQuotes transform: language-depended quote characters.milde2012-11-261-6/+77
| | | | git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk/docutils@7540 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Smartquotes: correct "educating" of quotes around inline markup.milde2012-11-181-2/+81
| | | | git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk/docutils@7537 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Add SmartQuotes transform for typographic quotes and dashes.milde2012-10-161-0/+51
| | | | git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk/docutils@7530 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Unit test of the strip_elements_with_classes config setting.milde2012-08-161-0/+61
| | | | git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk/docutils@7496 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Copy the "rawsource" attribute as well when doing node.copy() or ↵gbrandl2010-07-031-0/+1
| | | | | | | | node.deepcopy(). Adjust the tests accordingly. See http://sourceforge.net/mailarchive/forum.php?thread_name=AANLkTimey1JHAuDk2tDKn2OxdQypbZ41LYZZ7KuxcSwM%40mail.gmail.com&forum_name=docutils-develop for discussion. git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk/docutils@6351 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* adjusted name and email addresswiemann2007-05-313-3/+3
| | | | git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk/docutils@5174 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* added writer_aux.Admonitions transform;wiemann2006-08-161-0/+33
| | | | | | | | use it in html4css1 and newlatex2e; changed priority of writer_aux.Compound transform from 810 to 910; added (basic) admonition support to newlatex2e writer git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk/docutils@4687 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* merged directives branch to trunk (r4375:4666);wiemann2006-07-121-2/+8
| | | | | | | | assert that block quote directives have content; improved test for block quote directives (test_block_quotes); deleted test_epigraphs_etc (replaced by test_block_quotes) git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk/docutils@4667 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* use $Id$ instead of $Date$ and $Revision$;wiemann2006-05-2117-68/+34
| | | | | | | | collapsed Author and Contact fields; use canonical email addresses for David and Felix; (I have reviewed the diff) git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk/docutils@4564 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Fixed bug with circular substitution definitions that put Docutils into an ↵goodger2005-12-281-0/+84
| | | | | | infinite loop. Circular substitution definitions are now detected & reported. git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk/docutils@4233 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Added the universal.StripComments transform, the "strip_comments" setting, ↵goodger2005-12-121-0/+49
| | | | | | and the --strip-comments/--leave-comments options. git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk/docutils@4183 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* keep "Authors" field name, no matter how many authors listedgoodger2005-12-111-4/+6
| | | | git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk/docutils@4173 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* merged branches/s5 changes r4011:4155 into trunk/docutilsgoodger2005-12-081-0/+84
| | | | git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk/docutils@4156 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* corrected order of importsgoodger2005-12-034-3/+4
| | | | git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk/docutils@4132 929543f6-e4f2-0310-98a6-ba3bd3dd1d04