On Sep 22, 2009, at 12:32 PM, René wrote:
Bernt Hansen <bernt <at> norang.ca> writes:
You can ident the comment like this
1. first
2. second
# comment about second item
3. third
4. fourth
Unfortunately in this case your comment gets exported since the `#'
is indented.
Of course one doesn't want the comments to appear in the html
version of the
document.
Is there a way to easily solve this issue?
You can always add a function to one of the org-export-preprocess-...
hooks.
However, if you are not careful, you might remove something like
#!/bin/sh
in a source code block, or some normal text where,
#25 starts a new line by accident.
It may be relatively safe to look for # followed by space, or
lines that have only "#" ad the only nonwhite character on a line.
Something like this might work (untested)
(add-hook
'org-export-preprocess-before-backend-specifics-hook
(lambda ()
(goto-char (point-min))
(while (re-search-forward "^[ \t]+#\\([ \t]*$\\| .*$\\)\n?" nil t)
(org-if-unprotected-at (match-beginning 1)
(replace-match "")))))
HTH
- Carsten
_______________________________________________
Emacs-orgmode mailing list
Remember: use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode