diff options
| author | fdrake <fdrake@929543f6-e4f2-0310-98a6-ba3bd3dd1d04> | 2004-03-30 22:17:25 +0000 |
|---|---|---|
| committer | fdrake <fdrake@929543f6-e4f2-0310-98a6-ba3bd3dd1d04> | 2004-03-30 22:17:25 +0000 |
| commit | cac4685cb0442239fe73d2bd9b007ffb3a7317f4 (patch) | |
| tree | 0087c062f72417e36f3b0230cd110278226ec01e /docutils | |
| parent | 82a7c91551ba17af1813fdfe69688c794ee2ce3e (diff) | |
| download | docutils-cac4685cb0442239fe73d2bd9b007ffb3a7317f4.tar.gz | |
- allow RCS/CVS $keywords$ to be handled even if there is other text in the
relevant docinfo fields
(closes SF bug #926198)
- make the tests of the RCS/CVS $keyword$ handling less fragile in the face
of non-default -k options
(closes SF bug #921085)
git-svn-id: http://svn.code.sf.net/p/docutils/code/trunk/docutils@1898 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
Diffstat (limited to 'docutils')
| -rw-r--r-- | docutils/transforms/frontmatter.py | 6 | ||||
| -rw-r--r-- | docutils/utils.py | 2 |
2 files changed, 4 insertions, 4 deletions
diff --git a/docutils/transforms/frontmatter.py b/docutils/transforms/frontmatter.py index 00afc6fd2..1a45c1336 100644 --- a/docutils/transforms/frontmatter.py +++ b/docutils/transforms/frontmatter.py @@ -334,10 +334,10 @@ class DocInfo(Transform): return 1 rcs_keyword_substitutions = [ - (re.compile(r'\$' r'Date: (\d\d\d\d)/(\d\d)/(\d\d) [\d:]+ \$$', + (re.compile(r'\$' r'Date: (\d\d\d\d)/(\d\d)/(\d\d) [\d:]+ \$', re.IGNORECASE), r'\1-\2-\3'), - (re.compile(r'\$' r'RCSfile: (.+),v \$$', re.IGNORECASE), r'\1'), - (re.compile(r'\$[a-zA-Z]+: (.+) \$$'), r'\1'),] + (re.compile(r'\$' r'RCSfile: (.+),v \$', re.IGNORECASE), r'\1'), + (re.compile(r'\$[a-zA-Z]+: (.+) \$'), r'\1'),] def extract_authors(self, field, name, docinfo): try: diff --git a/docutils/utils.py b/docutils/utils.py index 2e60a6c6f..148845330 100644 --- a/docutils/utils.py +++ b/docutils/utils.py @@ -406,7 +406,7 @@ def clean_rcs_keywords(paragraph, keyword_substitutions): if len(paragraph) == 1 and isinstance(paragraph[0], nodes.Text): textnode = paragraph[0] for pattern, substitution in keyword_substitutions: - match = pattern.match(textnode.data) + match = pattern.search(textnode.data) if match: textnode.data = pattern.sub(substitution, textnode.data) return |
