Improve block parameter parsing
The actual parameter parsing logic in emacs org mode is quite complex [1]. All we want for now is to handle parameter values containing spaces [2]. Splitting on ` :` gets us close enough for now. As I'm very opposed to copying 100 lines of parameter parsing logic just to get exports right let's wait for use cases - no hurt in gathering requirements as we go. [1] https://github.com/bzg/org-mode/blob/master/lisp/ob-core.el#L1481 [2] I never ran into such parameters before and wrongly assumed that splitting on spaces would be enough. boy was i wrong - just look at that massive function [1]! that's why we can't have nice things!
This commit is contained in:
parent
b9f05878fa
commit
b3edd6c182
4 changed files with 33 additions and 1 deletions
3
org/testdata/blocks.html
vendored
3
org/testdata/blocks.html
vendored
|
@ -40,6 +40,9 @@ a source block with results
|
|||
a source block that only exports results
|
||||
</pre>
|
||||
<pre class="example">
|
||||
but the result block is
|
||||
</pre>
|
||||
<pre class="example">
|
||||
an example block with
|
||||
multiple lines including
|
||||
|
||||
|
|
8
org/testdata/blocks.org
vendored
8
org/testdata/blocks.org
vendored
|
@ -38,6 +38,14 @@ echo a source block that only exports results
|
|||
#+RESULTS:
|
||||
: a source block that only exports results
|
||||
|
||||
#+begin_src bash :cmdline -foo -bar :exports results
|
||||
# the code block is not rendered
|
||||
echo but the result block is
|
||||
#+end_src
|
||||
|
||||
#+RESULTS:
|
||||
: but the result block is
|
||||
|
||||
#+BEGIN_EXAMPLE foo bar baz
|
||||
an example block with
|
||||
multiple lines including
|
||||
|
|
8
org/testdata/blocks.pretty_org
vendored
8
org/testdata/blocks.pretty_org
vendored
|
@ -38,6 +38,14 @@ echo a source block that only exports results
|
|||
#+RESULTS:
|
||||
: a source block that only exports results
|
||||
|
||||
#+BEGIN_SRC bash :cmdline -foo -bar :exports results
|
||||
# the code block is not rendered
|
||||
echo but the result block is
|
||||
#+END_SRC
|
||||
|
||||
#+RESULTS:
|
||||
: but the result block is
|
||||
|
||||
#+BEGIN_EXAMPLE foo bar baz
|
||||
an example block with
|
||||
multiple lines including
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue