build: fix asciidoc snippet filter tag matching more strict, line must end with snippet tag instead of containing it fix e.g. issue with more than 9 numbered snippets in same file
Project: http://git-wip-us.apache.org/repos/asf/zest-java/repo Commit: http://git-wip-us.apache.org/repos/asf/zest-java/commit/9853ec94 Tree: http://git-wip-us.apache.org/repos/asf/zest-java/tree/9853ec94 Diff: http://git-wip-us.apache.org/repos/asf/zest-java/diff/9853ec94 Branch: refs/heads/develop Commit: 9853ec9428df4744e727bf0437a64ce6f263d6ab Parents: da65f86 Author: Paul Merlin <[email protected]> Authored: Sun Nov 6 01:43:18 2016 +0100 Committer: Paul Merlin <[email protected]> Committed: Sun Nov 6 01:43:18 2016 +0100 ---------------------------------------------------------------------- buildSrc/src/asciidoc/filters/snippet/snippet.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/zest-java/blob/9853ec94/buildSrc/src/asciidoc/filters/snippet/snippet.py ---------------------------------------------------------------------- diff --git a/buildSrc/src/asciidoc/filters/snippet/snippet.py b/buildSrc/src/asciidoc/filters/snippet/snippet.py index 9cb0bfb..0202ae4 100755 --- a/buildSrc/src/asciidoc/filters/snippet/snippet.py +++ b/buildSrc/src/asciidoc/filters/snippet/snippet.py @@ -6,9 +6,9 @@ # The ASF licenses this file to You under the Apache License, Version 2.0 # (the "License"); you may not use this file except in compliance with # the License. You may obtain a copy of the License at -# +# # http://www.apache.org/licenses/LICENSE-2.0 -# +# # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -58,7 +58,7 @@ def snippet(source=None, tag=None, tablength="4", snipMarker=" [...snip...]\n\n emitted = False for line in sourceFile: - if END in line: emit = False + if line.strip().endswith(END): emit = False if emit: emitted = True if not "SNIPPET" in line: @@ -70,7 +70,7 @@ def snippet(source=None, tag=None, tablength="4", snipMarker=" [...snip...]\n\n buff.append(indent + meat) else: buff.append('') - if START in line: + if line.strip().endswith(START): if emitted: buff.append(indent + snipMarker) emit = True
