summaryrefslogtreecommitdiff
path: root/docutils/utils
Commit message (Collapse)AuthorAgeFilesLines
* Update pygments integration.milde2021-01-031-6/+1
| | | | | | | Pygments no longer uses the pkg_resources.DistributionNotFound exception, so we don't need to import it. git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk/docutils@8599 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Don't drop "code" directive content if Warnings are silenced.milde2020-12-161-2/+2
| | | | | | | | | | | | | | Output the content without syntax highlight to prevent data loss. It is still recommended to solve the issue instead of just silencing the warning. (Languages that are unknown to the Pygments Lexer should be specified as :class: option value instead of directive argument.) Thanks to Jérôme Carretero for the report and suggestion. git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk/docutils@8596 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Fix link to 2-Clause BSD license.milde2020-09-047-8/+8
| | | | git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk/docutils@8554 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Apply patch for bug #399 Fixes in Korean translation by Shinjo Park.milde2020-08-221-1/+1
| | | | git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk/docutils@8541 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Fix #395.milde2020-07-141-1/+4
| | | | | | | | | | Use the empty string as document["source"] value, when there is no known source. Also ensure there is no error when a PEP is written not from a file. git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk/docutils@8527 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Minor formatting updates.milde2020-02-061-1/+0
| | | | git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk/docutils@8482 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Fix [ 383 ] Smart quotes around opening and separator characters.milde2020-01-261-62/+58
| | | | git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk/docutils@8469 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* trivial: Misc whitespace fixesmilde2019-08-276-662/+643
| | | | | | Signed-off-by: Stephen Finucane <stephen@that.guru> git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk/docutils@8376 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* py3: Wrap 'foo.keys()', 'zip(foo, bar') in 'list'milde2019-08-272-2/+2
| | | | | | | | | | | In Python 3, 'dict.keys()', 'zip' and 'map' no longer return a list but rather types 'dict_keys', 'zip' and 'map', respectively. You can't append to these types nor can you delete from them while in a loop. The simple solution to both issues is to wrap things in 'list'. Signed-off-by: Stephen Finucane <stephen@that.guru> git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk/docutils@8372 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* py3: Fix magic methodsmilde2019-08-271-14/+79
| | | | | | | | | Python 3 uses '__bool__' and '__next__', where Python 2 used '__nonzero__' and 'next'. Use the new names but add aliases. Based on patch by Stephen Finucane <stephen@that.guru> git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk/docutils@8371 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* py3: Handle 'urllib', 'urllib2' to 'urlib.*' renamemilde2019-08-271-2/+6
| | | | | | Signed-off-by: Stephen Finucane <stephen@that.guru> git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk/docutils@8370 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Formatting changes to facilitate integration of "py3" patchset.milde2019-08-273-9/+9
| | | | git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk/docutils@8367 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* py3: Replace 'ur' prefixmilde2019-08-273-27/+28
| | | | | | | | | | While the 'u' prefix was backported to Python 3.3 or thereabouts, 'ur' remains invalid in Python 3. Just escape all backslashes and use plain old 'u'. Based on patch by Stephen Finucane <stephen@that.guru> git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk/docutils@8366 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* py3: Replace 'foo.next()' with 'next(foo)'milde2019-08-262-2/+2
| | | | | | | | | The former only works in Python 2, while the latter works in Python 2.7 and 3.x. Signed-off-by: Stephen Finucane <stephen@that.guru> git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk/docutils@8361 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Consistent Python 3 checks.milde2019-08-262-2/+2
| | | | git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk/docutils@8360 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Use 'isinstance(foo, bar)' instead of 'type(foo) is bar'milde2019-08-261-1/+1
| | | | | | | | This one is more stylistic than anything. Signed-off-by: Stephen Finucane <stephen@that.guru> git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk/docutils@8359 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* py3: Use 'sorted(foo)' instead of 'foo.sort()'milde2019-08-261-2/+1
| | | | | | | | This works with iterators also (like 'dict.keys()' in Python 3) Signed-off-by: Stephen Finucane <stephen@that.guru> git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk/docutils@8357 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* py3: Replace deprecated form of raising exceptionmilde2019-08-261-4/+5
| | | | | | Signed-off-by: Stephen Finucane <stephen@that.guru> git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk/docutils@8353 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* py3: Resolve some additional undefined symbolsmilde2019-08-261-4/+4
| | | | | | | | Found with flake8 Signed-off-by: Stephen Finucane <stephen@that.guru> git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk/docutils@8352 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* py3: Add aliases for removed symbolsmilde2019-08-263-50/+22
| | | | | | | | | | Add aliases for symbols that have been removed in Python 3.x, namely basestring, unicode, unichr and StandardError. Signed-off-by: Stephen Finucane <stephen@that.guru> small fixes by Günter Milde. git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk/docutils@8348 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* py3: Switch to 'except foo as bar' syntaxmilde2019-08-262-3/+3
| | | | | | | | This is the only form supported in Python 3.x. Signed-off-by: Stephen Finucane <stephen@that.guru> git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk/docutils@8347 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* py3: Switch to print functionsmilde2019-08-264-14/+14
| | | | | | | | | | 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
* py3: Use new style classesmilde2019-08-262-2/+2
| | | | | | Signed-off-by: Stephen Finucane <stephen@that.guru> git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk/docutils@8345 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Drop support for Python 3.3milde2019-08-261-1/+1
| | | | | | | | | | This doesn't involve a whole lot of changes, but references to Python 3.3 (plus some to the already removed Python 2.6) are removed and 'setup.py' is updated as necessary. Signed-off-by: Stephen Finucane <stephen@that.guru> git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk/docutils@8338 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Fix #332 and #342 (smartquotes problems).milde2019-07-241-3/+4
| | | | | | | 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
* Fix [ 366 ] - move unescape() definition to `nodes`milde2019-07-231-12/+2
| | | | | | to avoid circular import dependency. git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk/docutils@8294 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Apply [ 153 ] Korean mappings by Thomas Sungjin Kang.milde2019-04-151-0/+1
| | | | git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk/docutils@8253 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* DocInfo transform must not use "rawsource" attribute for escaping.milde2018-11-201-7/+1
| | | | | | | | | | | 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 code_analyzer problem under Python 3.3.milde2018-01-161-1/+6
| | | | | | | Handle pkg_resources.DistributionNotFound error raised by pygments if no lexer can be found for a "code" role or directive. git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk/docutils@8213 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Remove flag to re.sub (not required and unsupported in 2.6).milde2018-01-141-1/+1
| | | | git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk/docutils@8211 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Fix #338: re.sub() flag argument at wrong position.milde2018-01-081-1/+1
| | | | | | Thanks to Jakub Wilk for reporting. git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk/docutils@8209 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Fix error reporting in wrapper for external tex2mathml converters.milde2018-01-041-9/+8
| | | | | | Thanks to Alan Isaac for reporting. git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk/docutils@8208 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Minor documentation update: smartquotes is still experimental.milde2017-11-081-5/+1
| | | | git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk/docutils@8202 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* New function `utils.unescape_rawsource`.milde2017-11-041-0/+7
| | | | | | | | | Removes backslashes and backslash-escaped whitespace from `rawsource` arguments. Required for fixes in definition list terms, author docinfo extraction, and smartquote escaping. git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk/docutils@8195 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* smartquotes: Fix bug #332.milde2017-10-251-41/+32
| | | | | | | | 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
* Small cleanup and formatting edits.milde2017-08-171-8/+5
| | | | | | | * Use `True` instead of 1 in boolean arguments. * Deprecate `unique_combinations` (obsoleted by `itertools.combinations`). git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk/docutils@8171 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* * Consolidated version numbering documentation in docs/dev/policies.txt ↵goodger2017-08-141-13/+15
| | | | | | | | | | (moved text from docs/dev/release.txt). * Updated docutils.utils.version_identifier for Python 2.6 (docutils.VersionInfo). * Moved code from tests/test/test_utils.py::HelperFunctionsTests.test_version_identifier to tests/test__init__.py::VersionInfoTests.test_version_identifier; uncommented lines in tests/test__init__.py::VersionInfoTests.test_version_info. * Added new tests/test/test_utils.py::HelperFunctionsTests.test_version_identifier. git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk/docutils@8165 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Drop compatibility code for Python 2.4 and 2.5.milde2017-08-112-12/+13
| | | | git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk/docutils@8163 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* added docutils.utils.version_identifier() and a testgoodger2017-07-081-1/+40
| | | | git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk/docutils@8141 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Fix [ 321 ] Import block might cause name error.milde2017-06-221-0/+2
| | | | git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk/docutils@8119 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* smart quotes: improve configurability of the transform, add more locales.milde2017-05-301-1/+15
| | | | | | | | | The lists of "literal" inline and block-level nodes not requiring smartquote conversions are now attributes of the Smartquote transform class. Added Bulgarian, Macedonian, and Norwegian (Bokmaal and Nynorsk) quotes. git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk/docutils@8095 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Apply patch [ 140 ] by Ville Skyttä (escape sequence deprecation fix).milde2017-05-301-1/+1
| | | | git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk/docutils@8094 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Minor documentation fixes.milde2017-05-231-4/+12
| | | | git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk/docutils@8073 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Improve smartquotes command line interface.milde2017-05-211-11/+28
| | | | | | | use locale to set default language, sort style help. git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk/docutils@8071 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Add "smartquotes-locales" setting.milde2017-05-081-1/+1
| | | | git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk/docutils@8068 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Fix a regression in [r8062] (extra space with French smartquotes again).milde2017-05-041-3/+6
| | | | git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk/docutils@8065 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* smartquotes: Add command line interface for stand-alone use (requires 2.7).milde2017-04-241-100/+144
| | | | git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk/docutils@8062 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Fix [ 317 ] Extra space inserted with French smartquotes .milde2017-04-241-1/+4
| | | | git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk/docutils@8061 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Document and update smartquotes.milde2017-04-101-78/+67
| | | | git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk/docutils@8056 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Really use the full NBSP inside French quotes.milde2017-03-311-1/+1
| | | | git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk/docutils@8054 929543f6-e4f2-0310-98a6-ba3bd3dd1d04