diff options
author | John MacFarlane <jgm@berkeley.edu> | 2016-01-24 14:15:06 -0800 |
---|---|---|
committer | John MacFarlane <jgm@berkeley.edu> | 2016-01-24 14:15:06 -0800 |
commit | 11c5831a1ff8f71e2ff850e83f012ea57cc14243 (patch) | |
tree | ab3f954a98963d03f656a96098868371b05569ca /src | |
parent | d0152847d7af45bbb9803e703dd64e0a309e448f (diff) | |
download | pandoc-11c5831a1ff8f71e2ff850e83f012ea57cc14243.tar.gz |
Make language extensions trigger highlighting.
For example, `py` will now work as well as `python`.
Closes jgm/highlighting-kate#83.
Diffstat (limited to 'src')
-rw-r--r-- | src/Text/Pandoc/Highlighting.hs | 3 |
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 |