aboutsummaryrefslogtreecommitdiff
path: root/IkiWiki/Plugin
diff options
context:
space:
mode:
authorSimon McVittie <smcv@debian.org>2017-05-16 07:58:12 +0100
committerSimon McVittie <smcv@debian.org>2017-05-16 08:09:15 +0100
commitc72dc5ddb79391ea9f518b4b76b9d1bb0f318649 (patch)
treea279f2e56b45e7d336b03e1ec3dffe89e5d5baae /IkiWiki/Plugin
parent94316fca549e76cedefc80e542d52460ba2dd5ce (diff)
downloadikiwiki-c72dc5ddb79391ea9f518b4b76b9d1bb0f318649.tar
ikiwiki-c72dc5ddb79391ea9f518b4b76b9d1bb0f318649.tar.gz
mdwn: Don't enable alphabetically labelled ordered lists by default
This avoids misinterpreting initials ("C. S. Lewis was an author"), the abbreviation for Monsieur ("M. Descartes was a philosopher") and German page numbering ("S. 42") as ordered lists if they happen to begin a line. This only affects the default Discount implementation: Text::Markdown and Text::MultiMarkdown do not have this feature anyway. A new mdwn_alpha_list option can be used to restore the old interpretation.
Diffstat (limited to 'IkiWiki/Plugin')
-rw-r--r--IkiWiki/Plugin/mdwn.pm13
1 files changed, 13 insertions, 0 deletions
diff --git a/IkiWiki/Plugin/mdwn.pm b/IkiWiki/Plugin/mdwn.pm
index e142fec46..9f06c03f2 100644
--- a/IkiWiki/Plugin/mdwn.pm
+++ b/IkiWiki/Plugin/mdwn.pm
@@ -41,10 +41,19 @@ sub getsetup () {
safe => 1,
rebuild => 1,
},
+ mdwn_alpha_lists => {
+ type => "boolean",
+ example => 0,
+ description => "interpret line like 'A. First item' as ordered list when using Discount?",
+ advanced => 1,
+ safe => 1,
+ rebuild => 1,
+ },
}
sub checkconfig () {
$config{mdwn_footnotes} = 1 unless defined $config{mdwn_footnotes};
+ $config{mdwn_alpha_lists} = 0 unless defined $config{mdwn_alpha_lists};
}
my $markdown_sub;
@@ -101,6 +110,10 @@ sub htmlize (@) {
$flags |= Text::Markdown::Discount::MKD_EXTRA_FOOTNOTE();
}
+ unless ($config{mdwn_alpha_lists}) {
+ $flags |= Text::Markdown::Discount::MKD_NOALPHALIST();
+ }
+
# Workaround for discount's eliding
# of <style> blocks.
# https://rt.cpan.org/Ticket/Display.html?id=74016