markdownr 0.6.10 → 0.6.11

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 352e2d418a6bf94404763caeaa5b8e43c5f07fa2bff53c208a60972b16420a7e
4
- data.tar.gz: e2b8d84227484fca2134dc9a1cffa67bebf3022134377945a9081dc19c6c3fe0
3
+ metadata.gz: 072ccb5cc0d25d1b06e7fc40cc51a6d4d71a03627fbf6569a822782a4151c8a4
4
+ data.tar.gz: '039ec59649a81611b158230190dee9c02343dc7fbbdf97008b8b05a116eecc66'
5
5
  SHA512:
6
- metadata.gz: 15653576feb66ee4cb2dd259ed2ce21e11ce6dd6872e5533b8d7c28eb5eafa2aa471b61d8997afcacfb86aa21ff7f442366ec16157014321feba7ed3627059d4
7
- data.tar.gz: ee7ea43025abdd7cc04a1238660985480664c7220fd98327331be5e93682d896e470525c4c9dc1186d235c3dc5885cde770012e29111e62e42d4bf99d1397494
6
+ metadata.gz: eb6dab68fec96f02ff6c3c1243196d64166e489e78ea2ffc77423bb808d8737e52850fc51dadebe415a0258f8f53f2ed6bc42232efadca6b328620efe46853e5
7
+ data.tar.gz: 48f192f288f773f9fddc677fc68e0bc856f63780f4fa1e983bfbb2376d4b2be2ef2c4c520c95ba5988af2693cd2cced5ed599cea090948f28ae73d345a6db0a0
@@ -216,23 +216,30 @@ module MarkdownServer
216
216
  def resolve_wiki_link(name)
217
217
  filename = "#{name}.md"
218
218
  base = File.realpath(root_dir)
219
+ # On case-sensitive filesystems (Linux/Docker), FNM_CASEFOLD doesn't help
220
+ # with directory listings. Try exact filename first, then lowercased variant.
221
+ candidates = [filename]
222
+ candidates << filename.downcase if filename != filename.downcase
219
223
 
220
224
  # Check the current file's directory first (exact case, then case-insensitive)
221
225
  if @current_wiki_dir
222
226
  local_exact = nil
223
227
  local_ci = nil
224
- Dir.glob(File.join(@current_wiki_dir, filename), File::FNM_CASEFOLD).each do |path|
225
- real = File.realpath(path) rescue next
226
- next unless real.start_with?(base)
227
- relative = real.sub("#{base}/", "")
228
- first_segment = relative.split("/").first
229
- next if EXCLUDED.include?(first_segment) || first_segment&.start_with?(".")
230
- if File.basename(real) == filename
231
- local_exact = relative
232
- break
233
- else
234
- local_ci ||= relative
228
+ candidates.each do |fn|
229
+ Dir.glob(File.join(@current_wiki_dir, fn)).each do |path|
230
+ real = File.realpath(path) rescue next
231
+ next unless real.start_with?(base)
232
+ relative = real.sub("#{base}/", "")
233
+ first_segment = relative.split("/").first
234
+ next if EXCLUDED.include?(first_segment) || first_segment&.start_with?(".")
235
+ if File.basename(real) == filename
236
+ local_exact = relative
237
+ break
238
+ else
239
+ local_ci ||= relative
240
+ end
235
241
  end
242
+ break if local_exact
236
243
  end
237
244
  return local_exact if local_exact
238
245
  return local_ci if local_ci
@@ -241,17 +248,20 @@ module MarkdownServer
241
248
  # Fall back to global recursive search
242
249
  exact_match = nil
243
250
  ci_match = nil
244
- Dir.glob(File.join(base, "**", filename), File::FNM_CASEFOLD).each do |path|
245
- real = File.realpath(path) rescue next
246
- next unless real.start_with?(base)
247
- relative = real.sub("#{base}/", "")
248
- first_segment = relative.split("/").first
249
- next if EXCLUDED.include?(first_segment) || first_segment&.start_with?(".")
250
- if File.basename(real) == filename
251
- exact_match ||= relative
252
- else
253
- ci_match ||= relative
251
+ candidates.each do |fn|
252
+ Dir.glob(File.join(base, "**", fn)).each do |path|
253
+ real = File.realpath(path) rescue next
254
+ next unless real.start_with?(base)
255
+ relative = real.sub("#{base}/", "")
256
+ first_segment = relative.split("/").first
257
+ next if EXCLUDED.include?(first_segment) || first_segment&.start_with?(".")
258
+ if File.basename(real) == filename
259
+ exact_match ||= relative
260
+ else
261
+ ci_match ||= relative
262
+ end
254
263
  end
264
+ break if exact_match
255
265
  end
256
266
 
257
267
  exact_match || ci_match
@@ -1,3 +1,3 @@
1
1
  module MarkdownServer
2
- VERSION = "0.6.10"
2
+ VERSION = "0.6.11"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: markdownr
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.10
4
+ version: 0.6.11
5
5
  platform: ruby
6
6
  authors:
7
7
  - Brian Dunn