From e8ce478ef6bd24cb4986c3d4f30ff5904f8a867c Mon Sep 17 00:00:00 2001 From: Atlas48 Date: Mon, 15 Feb 2021 20:36:32 +0000 Subject: [PATCH] Update jekyll/converters/textile.rb Added support for arrays. --- README.md | 10 ++++++++++ lib/jekyll/converters/textile.rb | 7 ++++++- 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 6b5b11b..fbd5e06 100644 --- a/README.md +++ b/README.md @@ -34,6 +34,16 @@ specify a comma-separated list of extensions in your `_config.yml`, like this: textile_ext: "textile,txtl,tl" + +You can also use an array: + +```yaml +textile_ext: + - textile + - txtl + - tl +``` + If that is the given configuration, then all files with `.textile`, `.txtl`, and `.tl` file extensions will be read in and interpreted as Textile. They must still contain YAML front matter. diff --git a/lib/jekyll/converters/textile.rb b/lib/jekyll/converters/textile.rb index 3ededae..e96f97e 100644 --- a/lib/jekyll/converters/textile.rb +++ b/lib/jekyll/converters/textile.rb @@ -29,7 +29,12 @@ def setup end def extname_list - @extname_list ||= @config['textile_ext'].split(',').map { |e| ".#{e}" } + case @config['textile_ext'] + when String + @extname_list ||= @config['textile_ext'].split(',').map { |e| ".#{e}" } + when Array + @extname_list ||= @config['textile_ext'].map { |e| ".#{e}" } + end end def matches(ext)