summaryrefslogtreecommitdiff
path: root/src/Text/Pandoc
diff options
context:
space:
mode:
authorJohn MacFarlane <jgm@berkeley.edu>2016-01-24 14:15:06 -0800
committerJohn MacFarlane <jgm@berkeley.edu>2016-01-24 14:15:06 -0800
commit11c5831a1ff8f71e2ff850e83f012ea57cc14243 (patch)
treeab3f954a98963d03f656a96098868371b05569ca /src/Text/Pandoc
parentd0152847d7af45bbb9803e703dd64e0a309e448f (diff)
Make language extensions trigger highlighting.
For example, `py` will now work as well as `python`. Closes jgm/highlighting-kate#83.
Diffstat (limited to 'src/Text/Pandoc')
-rw-r--r--src/Text/Pandoc/Highlighting.hs3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/Text/Pandoc/Highlighting.hs b/src/Text/Pandoc/Highlighting.hs
index d7a14c129..ecfef1832 100644
--- a/src/Text/Pandoc/Highlighting.hs
+++ b/src/Text/Pandoc/Highlighting.hs
@@ -70,7 +70,8 @@ highlight formatter (_, classes, keyvals) rawCode =
startNumber = firstNum,
numberLines = any (`elem`
["number","numberLines", "number-lines"]) classes }
- lcclasses = map (map toLower) classes
+ lcclasses = map (map toLower)
+ (classes ++ concatMap languagesByExtension classes)
in case find (`elem` lcLanguages) lcclasses of
Nothing
| numberLines fmtOpts -> Just