diff --git a/History.markdown b/History.markdown index 98b50b76..d7af2ccc 100644 --- a/History.markdown +++ b/History.markdown @@ -164,7 +164,6 @@ * Update TestTags in sync with Rouge v3.4 (#7709) * Bump RuboCop to v0.71.0 (#7687) * Use regexp to filter special entries (#7702) - * Replace `String#=~` with `String#match?` (#7718) * Reduce Array objects generated from utility method (#7749) ### Documentation diff --git a/lib/jekyll/tags/include.rb b/lib/jekyll/tags/include.rb index b43fe453..20a41bb7 100644 --- a/lib/jekyll/tags/include.rb +++ b/lib/jekyll/tags/include.rb @@ -54,7 +54,7 @@ module Jekyll end def validate_file_name(file) - if file.match?(INVALID_SEQUENCES) || !file.match?(VALID_FILENAME_CHARS) + if INVALID_SEQUENCES.match?(file) || !VALID_FILENAME_CHARS.match?(file) raise ArgumentError, <<~MSG Invalid syntax for include tag. File contains invalid characters or sequences: @@ -90,7 +90,7 @@ module Jekyll # Render the variable if required def render_variable(context) - Liquid::Template.parse(@file).render(context) if @file.match?(VARIABLE_SYNTAX) + Liquid::Template.parse(@file).render(context) if VARIABLE_SYNTAX.match?(@file) end def tag_includes_dirs(context)