emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Thorsten Jolitz <tjolitz@gmail.com>
To: emacs-orgmode@gnu.org
Subject: Re: Org mode export to HTML not working correctly with code blocks if block is after an item (-) and its delimiters are indented
Date: Wed, 16 Oct 2013 04:41:06 +0200	[thread overview]
Message-ID: <87txgi0wfx.fsf@gmail.com> (raw)
In-Reply-To: 525DE996.2000408@gmail.com

Omid <omidlink@gmail.com> writes:

> - This does NOT export correctly (code block is not detected)
>   #+BEGIN_SRC sh
> ls
>   #+END_SRC
>
> Is there any way around this behavior without removing the indentation
> for the code block delimiters?

I think the 'official'regexp to detect a src-block starts like this

,----------------------------------
| "^\\([ \t]*\\)#\\+begin_src [...]
`----------------------------------

so I would guess that this should work, and its a bug if it doesn't.

Inside a list like this

 - First item

   #+begin_src emacs-lisp :exports both
    (+ 3 4)
   #+end_src

 - Second Item

   Some text

it should work too, lets test:

#+begin_src emacs-lisp :exports value
   (with-current-buffer
       (current-buffer)
     (org-export-as 'ascii))
#+end_src

,-----------------------------------------------------------------------
| #+results:
|                            _________________
|
|                                   427
|
|                             Thorsten Jolitz
|                            _________________
|
|
|
|
|
| 1 --text follows this line--
| ============================
|
|   Omid <omidlink@gmail.com> writes:
|
|   > - This does NOT export correctly (code block is not detected)
|   > #+BEGIN_SRC sh ls #+END_SRC Is there any way around this behavior
|   > without removing the indentation for the code block delimiters?
|
|   I think the 'official'regexp to detect a src-block starts like this
|
|   ,----------------------------------
|   "^\\([ \t]*\\)#\\+begin_src [...]
|   `----------------------------------
|
|   so I would guess that this should work, and its a bug if it doesn't.
|
|   Inside a list like like this
|
|   - First item
|
|     ,----
|     | (+ 3 4)
|     `----
|
|   ,----
|   | 7
|   `----
|
|
|   - Second Item
|
|     Some text
|
|   it should work too, lets test:
|
|   ,----
|   | (with-current-buffer
|   |     (current-buffer)
|   |   (org-export-as 'ascii))
|   `----
|
|
|   -- cheers, Thorsten
`-----------------------------------------------------------------------

looks as if it works for me ...

--
cheers,
Thorsten

  reply	other threads:[~2013-10-16  2:41 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-10-16  1:19 Org mode export to HTML not working correctly with code blocks if block is after an item (-) and its delimiters are indented Omid
2013-10-16  2:41 ` Thorsten Jolitz [this message]
2013-10-16  2:53 ` Thorsten Jolitz
2013-10-16  3:12   ` Omid
2013-10-16 11:25 ` Nicolas Goaziou
2014-02-05 20:40 ` Behavior of Org mode Babel code snippets with respect to M-q (fill-paragraph) and C-/ (undo) Omid
2014-02-05 21:34   ` Nick Dokos
2014-02-05 23:02     ` Omid
2014-02-13 23:38       ` Samuel Wales
2014-02-14  0:21         ` Samuel Wales
2014-03-21  7:56           ` Bastien
2014-05-25 20:37   ` Is there a variable/way to change <div id="content"> to something else, e.g. <div class="container"> for use with Bootstrap CSS? Omid
2014-05-26  2:10     ` Eric Abrahamsen
2014-05-26  4:08       ` Omid
2014-05-26  4:26         ` Omid
2014-05-26  5:11           ` Eric Abrahamsen
2014-05-26  6:28             ` Omid

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87txgi0wfx.fsf@gmail.com \
    --to=tjolitz@gmail.com \
    --cc=emacs-orgmode@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).