Skip to content
This repository


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Correctly extract the page name from the basename.

Before, page names like sysctl.conf or blueprint.cfg would not be allowed and instead would be truncated so an input file blueprint.cfg.5.ronn for blueprint.cfg(5) would write files blueprint.5 and blueprint.5.html.

This makes the assumption that *.{ronn,md,mkd,mkdn,markdown} are the only file extensions one would use for these files.  <> seems to support this assumption.
  • Loading branch information...
commit e3504f2b751e09572535538f6b674b4ee1059c17 1 parent 5cabf64
Richard Crowley authored

Showing 1 changed file with 1 addition and 1 deletion. Show diff stats Hide diff stats

  1. +1 1  lib/ronn/document.rb
2  lib/ronn/document.rb
@@ -110,7 +110,7 @@ def path_for(type=nil)
110 110 # available. This is used as the manual page name when the
111 111 # file contents do not include a name section.
112 112 def path_name
113   - @basename[/^[^.]+/] if @basename
  113 + $1 if @basename =~ /^(.+)\.[12345678]\.(?:ronn|md|mkdn?|markdown)$/
114 114 end
115 115
116 116 # Returns the <section> part of the path, or nil when

0 comments on commit e3504f2

I think [1-8] would be a nicer way to say [12345678]. :-)

Please sign in to comment.
Something went wrong with that request. Please try again.