0
0
Fork 1
mirror of https://git.savannah.gnu.org/git/emacs/org-mode.git synced 2024-08-27 09:32:52 +00:00

Add language-specific class to source code examples.

This commit is contained in:
Carsten Dominik 2008-07-17 09:22:49 -07:00
parent b24a83f395
commit c780c3e550

View file

@ -2008,8 +2008,9 @@ backends, it converts the segment into an EXAMPLE segment."
(org-export-htmlize-region-for-paste
(point-min) (point-max)))))
(if (string-match "<pre\\([^>]*\\)>\n?" htmltext)
(setq htmltext (replace-match "<pre class=\"src\">"
t t htmltext)))
(setq htmltext (replace-match
(format "<pre class=\"src src-%s\">" lang)
t t htmltext)))
(concat "#+BEGIN_HTML\n" htmltext "\n#+END_HTML\n"))))
(t
;; This is not HTML, so just make it an example.
@ -2937,7 +2938,7 @@ lang=\"%s\" xml:lang=\"%s\">
(string-match "^[ \t]*:\\(.*\\)" line))
(when (not infixed)
(setq infixed t)
(insert "<pre>\n"))
(insert "<pre class=\"example\">\n"))
(insert (org-html-protect (match-string 1 line)) "\n")
(when (or (not lines)
(not (string-match "^[ \t]*\\(:.*\\)"