Skip to content

Fix include-tagged when tags are similar#172

Merged
nik9000 merged 3 commits intoelastic:masterfrom
nik9000:include_tagged_trailing
May 2, 2017
Merged

Fix include-tagged when tags are similar#172
nik9000 merged 3 commits intoelastic:masterfrom
nik9000:include_tagged_trailing

Conversation

@nik9000
Copy link
Copy Markdown
Member

@nik9000 nik9000 commented Apr 26, 2017

If one tag is a prefix of another tag then include-tagged the
suffix could be included instead of the prefix if it came first
in the file. This fixes that by expecting the tag to be followed
by only spaces and a newline.

If one tag is a prefix of another tag then `include-tagged` the
suffix could be included instead of the prefix if it came first
in the file. This fixes that by expecting the tag to be followed
by only spaces and a newline.
@nik9000 nik9000 added the bug Something that does not look or behave correctly label Apr 26, 2017
import re
start = re.compile('^(\s+).+tag::' + tag)
end = re.compile('end::' + tag)
start = re.compile('^(\s+).+tag::' + tag + '\s*\n')
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

\s* will also match \n, so you could do \s*?\n, or maybe even tag + '\b' is sufficient?

@nik9000
Copy link
Copy Markdown
Member Author

nik9000 commented Apr 27, 2017

@clintongormley \b works for me! I've pushed that.

@nik9000
Copy link
Copy Markdown
Member Author

nik9000 commented May 1, 2017

@clintongormley can you have a look? I know you are busy but I figured it'd be nice to get this and elastic/elasticsearch#24354 in.

@nik9000 nik9000 merged commit 2ee6017 into elastic:master May 2, 2017
@nik9000 nik9000 deleted the include_tagged_trailing branch February 19, 2019 15:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something that does not look or behave correctly

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants