lib/nanoc/data_sources/filesystem.rb in nanoc-4.11.17 vs lib/nanoc/data_sources/filesystem.rb in nanoc-4.11.18
- old
+ new
@@ -360,13 +360,13 @@
return Nanoc::Core::Identifier.new(filename)
end
regex =
if /(^|\/)index(\.[^\/]+)?$/.match?(filename)
- allow_periods_in_identifiers? ? /\/?(index)?(\.[^\/\.]+)?$/ : /\/?index(\.[^\/]+)?$/
+ allow_periods_in_identifiers? ? /\/?(index)?(\.[^\/.]+)?$/ : /\/?index(\.[^\/]+)?$/
else
- allow_periods_in_identifiers? ? /\.[^\/\.]+$/ : /\.[^\/]+$/
+ allow_periods_in_identifiers? ? /\.[^\/.]+$/ : /\.[^\/]+$/
end
Nanoc::Core::Identifier.new(filename.sub(regex, ''), type: :legacy)
end
# Returns the base name of filename, i.e. filename with the first or all
@@ -388,10 +388,10 @@
# leading period.
#
# @return [Regex]
def extension_regex
if allow_periods_in_identifiers?
- /(\.[^\/\.]+$)/
+ /(\.[^\/.]+$)/
else
/(\.[^\/]+$)/
end
end