From 7599de6e436fd141a8027ad65d5a2b0b03ea6f98 Mon Sep 17 00:00:00 2001 From: "http://www.cse.unsw.edu.au/~willu/" Date: Fri, 13 Feb 2009 06:16:18 -0500 Subject: Add a new bug to track simple patch --- doc/todo/Allow_filenames_that_are_all_type.mdwn | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 doc/todo/Allow_filenames_that_are_all_type.mdwn (limited to 'doc/todo') diff --git a/doc/todo/Allow_filenames_that_are_all_type.mdwn b/doc/todo/Allow_filenames_that_are_all_type.mdwn new file mode 100644 index 000000000..55e29b645 --- /dev/null +++ b/doc/todo/Allow_filenames_that_are_all_type.mdwn @@ -0,0 +1,20 @@ +This is a [[patch]] to allow filenames that are just the type. The best example of this is wanting to +pass a `Makefile` through one of the [[todo/syntax_highlighting/]] plugins. With this patch, +if the plugin can process files of type `.Makefile` then it will also process `Makefile`. + +I put this patch on the [[todo/syntax_highlighting/]] page a while ago, but it seemed to get +lost because it didn't have its own bug to track it. Now it does :). -- [[Will]] + + diff --git a/IkiWiki.pm b/IkiWiki.pm + index 8d728c9..1bd46a9 100644 + --- a/IkiWiki.pm + +++ b/IkiWiki.pm + @@ -618,6 +618,8 @@ sub pagetype ($) { + + if ($page =~ /\.([^.]+)$/) { + return $1 if exists $hooks{htmlize}{$1}; + + } elsif ($hooks{htmlize}{$page}{keepextension}) { + + return $page; + } + return; + } -- cgit v1.2.3