summaryrefslogtreecommitdiff
path: root/docutils/utils/smartquotes.py
Commit message (Collapse)AuthorAgeFilesLines
* Unify naming of the "utf-8" codec.milde2022-06-131-1/+1
| | | | git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk/docutils@9068 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Do not use bare 'except'.milde2022-03-051-1/+1
| | | | | | | | | | flake8 rule E722 Exception: as catchall, if * the right thing to do does not depend on the error * any error is reported or risen again. git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk/docutils@9033 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Avoid multiple statements on one line. Fix redundant backslashmilde2022-03-051-8/+8
| | | | | | | | | | | | Exceptions for sets of empty class definitions and other cases where it improves comprehension. flake8 rules E502: the backslash is redundant between brackets E701: multiple statements on one line (colon) E704: multiple statements on one line (def) git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk/docutils@9032 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Avoid too long lines.milde2022-03-051-109/+112
| | | | | | flake8 rule E501: line too long (N > 79 characters) git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk/docutils@9030 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Fix imports.milde2022-03-051-23/+23
| | | | | | | | flake8 rules E401: multiple imports on one line E402: module level import not at top of file git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk/docutils@9027 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Ensure 2 blank lines around top-level functions and classes.milde2022-03-041-0/+1
| | | | | | | | flake8 rules E302: expected 2 blank lines, found 1 E305: expected 2 blank lines after class or function definition git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk/docutils@9026 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Remove excess blank lines.milde2022-03-041-3/+0
| | | | | | flakei rule E303: too many blank lines (N) git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk/docutils@9025 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Ensure at least two spaces before inline comment.milde2022-03-041-55/+52
| | | | | | | | | flake 8 rule E261 Exceptions for modules sheduled for removal or with 3rd-party origin and for data collections. git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk/docutils@9021 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Fix multiple spaces before/after operatormilde2022-03-031-14/+14
| | | | | | | E221 multiple spaces before operator E222 multiple spaces after operator git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk/docutils@9016 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Fix code indentationmilde2022-01-291-2/+2
| | | | | | | | | | | | | | | | | | | | Check conformance to our coding policies with flake8. Fix the following problems: E111 indentation is not a multiple of four E114 indentation is not a multiple of four (comment) E115 expected an indented block (comment) E116 unexpected indentation (comment) E117 over-indented E121 continuation line under-indented for hanging indent E122 continuation line missing indentation or outdented E124 closing bracked does not match visual indentaion E127 continuation line over-indented for visual indent E128 continuation line under-indented for visual indent E131 continuation line unaligned for hanging indent git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk/docutils@8994 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Smartquotes 1.8.2: Code cleanup. Require Python 3.milde2022-01-271-50/+36
| | | | git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk/docutils@8988 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* New style classes no longer need to inherit from `object`.milde2022-01-261-1/+1
| | | | | | Patch by Adam Turner. git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk/docutils@8984 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Drop string prefix "u".milde2022-01-261-102/+102
| | | | git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk/docutils@8983 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Remove redundant parenthesesmilde2022-01-261-3/+3
| | | | | | Patch by Adam Turner. git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk/docutils@8976 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Remove re.U(NICODE), it is the default in Python 3milde2022-01-261-5/+5
| | | | | | https://docs.python.org/3/library/re.html#re.ASCII git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk/docutils@8975 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Use generator expressions with functions expecting a sequence.milde2022-01-261-3/+3
| | | | | | Based on patches by Adam Turner git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk/docutils@8970 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Update URLs in the docs.milde2022-01-211-2/+2
| | | | | | | | Mostly http: -> https:, based on a patch by Adam Turner Remove/update some dead links. git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk/docutils@8959 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Change http://docutils.sf.net -> https://docutils.sourceforge.iomilde2022-01-201-1/+1
| | | | | | Patch by Adam Turner. git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk/docutils@8954 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Module "locale" is supported by Jython since version 2.7.2.milde2022-01-111-1/+1
| | | | | | | | | Cf. https://github.com/jython/jython/commit/c5509579 Jython does not support Python3 at the moment, so we don't need to care about earlier versions in Docutils >= 0.19. git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk/docutils@8941 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Remove "coding:" slugmilde2022-01-031-2/+0
| | | | | | Only required with Python 2.x. Encoding in Py3k is utf8 by default. git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk/docutils@8926 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Remove 2.7-compatibility __future__ imports.milde2022-01-031-2/+1
| | | | git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk/docutils@8925 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Fix spellingmilde2021-10-221-2/+2
| | | | git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk/docutils@8860 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* fix deprecation warninggrubert2021-04-091-1/+1
| | | | git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk/docutils@8679 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Fix link to 2-Clause BSD license.milde2020-09-041-2/+2
| | | | 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 [ 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-271-4/+4
| | | | | | 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: Replace 'ur' prefixmilde2019-08-271-11/+13
| | | | | | | | | | 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: Switch to print functionsmilde2019-08-261-9/+10
| | | | | | | | | | 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 #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
* 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
* 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
* 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
* 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
* 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
* 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
* Update smartquotes: milde2017-03-311-20/+20
| | | | | | | | | | | | | * 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-42/+72
| | | | | | 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-6/+20
| | | | git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk/docutils@8017 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Fix swedisch smartquotes.milde2016-12-191-2/+3
| | | | git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk/docutils@8004 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Fix smart quotes definition for swedish (sv).milde2016-12-101-2/+3
| | | | git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk/docutils@7993 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Various minor documentation edits.milde2016-01-131-1/+1
| | | | git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk/docutils@7933 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Add contributed patch for danish smartquotes.milde2013-08-211-0/+2
| | | | git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk/docutils@7716 929543f6-e4f2-0310-98a6-ba3bd3dd1d04