From bd678ecb59f70778fdb3b08bdcd39e2ab7379b45 Mon Sep 17 00:00:00 2001 From: Thomas Leitner Date: Mon, 25 Apr 2022 14:55:42 +0200 Subject: [PATCH] Define the list_indent option to make it generally usable --- lib/kramdown/converter/kramdown.rb | 2 +- lib/kramdown/options.rb | 7 +++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/lib/kramdown/converter/kramdown.rb b/lib/kramdown/converter/kramdown.rb index 9196a6f7..32e0c2d2 100644 --- a/lib/kramdown/converter/kramdown.rb +++ b/lib/kramdown/converter/kramdown.rb @@ -27,7 +27,7 @@ def initialize(root, options) @footnotes = [] @abbrevs = [] @stack = [] - @list_indent = options[:list_indent] || 2 + @list_indent = @options[:list_indent] @list_spacing = ' ' * (@list_indent - 2) end diff --git a/lib/kramdown/options.rb b/lib/kramdown/options.rb index 1a4b3560..2b3dd05c 100644 --- a/lib/kramdown/options.rb +++ b/lib/kramdown/options.rb @@ -605,6 +605,13 @@ def self.simple_hash_validator(val, name) simple_array_validator(val, :forbidden_inline_options) end + define(:list_indent, Integer, 2, <<~EOF) + Sets the number of spaces to use for list indentation + + Default: 2 + Used by: Kramdown converter + EOF + end end