diff options
author | Takeshi KOMIYA <i.tkomiya@gmail.com> | 2017-03-26 18:13:31 +0900 |
---|---|---|
committer | Takeshi KOMIYA <i.tkomiya@gmail.com> | 2017-03-26 18:13:50 +0900 |
commit | 1dea386bc4ebf71d96a61021bf928fd345368602 (patch) | |
tree | cd974a94e2affd82380c020f7d17b06eb86e8d15 /sphinx/directives/code.py | |
parent | 8a98a1ad3d153caa39b3fa5d953790f89cd18b83 (diff) | |
download | sphinx-git-1dea386bc4ebf71d96a61021bf928fd345368602.tar.gz |
Fix #3108: Show warning if :start-at: and other literalinclude options does not match to the text
Diffstat (limited to 'sphinx/directives/code.py')
-rw-r--r-- | sphinx/directives/code.py | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/sphinx/directives/code.py b/sphinx/directives/code.py index 7ae95b131..c08c233a7 100644 --- a/sphinx/directives/code.py +++ b/sphinx/directives/code.py @@ -314,6 +314,11 @@ class LiteralIncludeReader(object): self.lineno_start += lineno return lines[lineno:] + else: + if inclusive is True: + raise ValueError('start-after pattern not found: %s' % start) + else: + raise ValueError('start-at pattern not found: %s' % start) return lines @@ -338,6 +343,11 @@ class LiteralIncludeReader(object): return [] else: return lines[:lineno] + else: + if inclusive is True: + raise ValueError('end-at pattern not found: %s' % end) + else: + raise ValueError('end-before pattern not found: %s' % end) return lines |