From 04658c491b94ed851c201f0d298e8dd398f81363 Mon Sep 17 00:00:00 2001 From: Albert Krewinkel Date: Sun, 23 Apr 2017 11:54:36 +0200 Subject: Org reader: handle line numbering switch for src blocks The line-numbering switch that can be given to source blocks (`-n` with an start number as an optional parameter) is parsed and translated to a class/key-value combination used by highlighting and other readers and writers. --- test/Tests/Readers/Org.hs | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'test') diff --git a/test/Tests/Readers/Org.hs b/test/Tests/Readers/Org.hs index 48f4989ce..4801bea3a 100644 --- a/test/Tests/Readers/Org.hs +++ b/test/Tests/Readers/Org.hs @@ -1556,6 +1556,15 @@ tests = params = [ ("rundoc-language", "sh"), ("rundoc-noeval", "yes") ] in codeBlockWith ("", classes, params) "echo $HOME\n" + , "Source block with line number switch" =: + unlines [ "#+BEGIN_SRC sh -n 10" + , ":() { :|:& };:" + , "#+END_SRC" + ] =?> + let classes = [ "bash", "numberLines" ] + params = [ ("startFrom", "10") ] + in codeBlockWith ("", classes, params) ":() { :|:& };:\n" + , "Example block" =: unlines [ "#+begin_example" , "A chosen representation of" -- cgit v1.2.3