Skip to main content
added 26 characters in body
Source Link
rasmus
  • 2.8k
  • 15
  • 20

Maybe something like this:

(defun rasmus/org-html-wrap-blocks-in-code (src backend info)
  "Wrap a source block in <code><pre><code class=\"lang\">.</code>"code></pre>"
  (when (org-export-derived-backend-p backend 'html)
    (replace-regexp-in-string
     "\\(</pre>\\)" "</code>\n\\1"
     (replace-regexp-in-string "<pre class=\"src src-\\([^\"]*?\\)\">"
                               "<pre>\n<code class=\"\\1\">\n" src))))

(add-to-list 'org-export-filter-src-block-functions
             'rasmus/org-html-wrap-blocks-in-code)

(setq org-html-htmlize-output-type nil)

Maybe something like this:

(defun rasmus/org-html-wrap-blocks-in-code (src backend info)
  "Wrap a source block in <code>.</code>"
  (when (org-export-derived-backend-p backend 'html)
    (replace-regexp-in-string
     "\\(</pre>\\)" "</code>\n\\1"
     (replace-regexp-in-string "<pre class=\"src src-\\([^\"]*?\\)\">"
                               "<pre>\n<code class=\"\\1\">\n" src))))

(add-to-list 'org-export-filter-src-block-functions
             'rasmus/org-html-wrap-blocks-in-code)

(setq org-html-htmlize-output-type nil)

Maybe something like this:

(defun rasmus/org-html-wrap-blocks-in-code (src backend info)
  "Wrap a source block in <pre><code class=\"lang\">.</code></pre>"
  (when (org-export-derived-backend-p backend 'html)
    (replace-regexp-in-string
     "\\(</pre>\\)" "</code>\n\\1"
     (replace-regexp-in-string "<pre class=\"src src-\\([^\"]*?\\)\">"
                               "<pre>\n<code class=\"\\1\">\n" src))))

(add-to-list 'org-export-filter-src-block-functions
             'rasmus/org-html-wrap-blocks-in-code)

(setq org-html-htmlize-output-type nil)
deleted 49 characters in body
Source Link
rasmus
  • 2.8k
  • 15
  • 20

Maybe something like this:

(defun rasmus/org-html-wrap-blocks-in-code (src backend info)
  "Wrap a source block in <code>.</code>"
  (when (org-export-derived-backend-p backend 'html)
    (replace-regexp-in-string
     "\\(</pre>\\)" "</code>\n\\1"
     (replace-regexp-in-string "<pre class=\"src src-\\([^\"]*?\\)\">"
                               "<pre>\n<code class=\"\\1\">\n" src))))

(add-to-list 'org-export-filter-src-block-functions
             'rasmus/org-html-wrap-blocks-in-code)

(setq org-html-htmlize-output-type nil)

 
(setq org-html-htmlize-output-type nil)

Maybe something like this:

(defun rasmus/org-html-wrap-blocks-in-code (src backend info)
  "Wrap a source block in <code>.</code>"
  (when (org-export-derived-backend-p backend 'html)
    (replace-regexp-in-string
     "\\(</pre>\\)" "</code>\n\\1"
     (replace-regexp-in-string "<pre class=\"src src-\\([^\"]*?\\)\">"
                               "<pre>\n<code class=\"\\1\">\n" src))))

(add-to-list 'org-export-filter-src-block-functions
             'rasmus/org-html-wrap-blocks-in-code)

(setq org-html-htmlize-output-type nil)

 
(setq org-html-htmlize-output-type nil)

Maybe something like this:

(defun rasmus/org-html-wrap-blocks-in-code (src backend info)
  "Wrap a source block in <code>.</code>"
  (when (org-export-derived-backend-p backend 'html)
    (replace-regexp-in-string
     "\\(</pre>\\)" "</code>\n\\1"
     (replace-regexp-in-string "<pre class=\"src src-\\([^\"]*?\\)\">"
                               "<pre>\n<code class=\"\\1\">\n" src))))

(add-to-list 'org-export-filter-src-block-functions
             'rasmus/org-html-wrap-blocks-in-code)

(setq org-html-htmlize-output-type nil)
added 40 characters in body
Source Link
rasmus
  • 2.8k
  • 15
  • 20

Maybe something like this:

  (defun rasmus/org-html-wrap-blocks-in-code (src backend info)
  "Wrap a source block in <code>.</code>"
  (when (org-export-derived-backend-p backend 'html)
    (replace-regexp-in-string
     "\\(</pre>\\)" "</code>\n\\1"
     (replace-regexp-in-string "<pre[^>]*"<pre class=\"src src-\\([^\"]*?>"\\)\">"
 "<pre>\n<code>\n"                              "<pre>\n<code class=\"\\1\">\n" src))))

(add-to-list 'org-export-filter-src-block-functions
             'rasmus/org-html-wrap-blocks-in-code)

(setq org-html-htmlize-output-type nil) 


(setq org-html-htmlize-output-type nil)

Maybe something like this:

  (defun rasmus/org-html-wrap-blocks-in-code (src backend info)
  "Wrap a source block in <code>.</code>"
  (when (org-export-derived-backend-p backend 'html)
    (replace-regexp-in-string
     "\\(</pre>\\)" "</code>\n\\1"
     (replace-regexp-in-string "<pre[^>]*?>" "<pre>\n<code>\n" src))))

(add-to-list 'org-export-filter-src-block-functions
             'rasmus/org-html-wrap-blocks-in-code)

(setq org-html-htmlize-output-type nil)

Maybe something like this:

(defun rasmus/org-html-wrap-blocks-in-code (src backend info)
  "Wrap a source block in <code>.</code>"
  (when (org-export-derived-backend-p backend 'html)
    (replace-regexp-in-string
     "\\(</pre>\\)" "</code>\n\\1"
     (replace-regexp-in-string "<pre class=\"src src-\\([^\"]*?\\)\">"
                               "<pre>\n<code class=\"\\1\">\n" src))))

(add-to-list 'org-export-filter-src-block-functions
             'rasmus/org-html-wrap-blocks-in-code)

(setq org-html-htmlize-output-type nil) 


(setq org-html-htmlize-output-type nil)
Source Link
rasmus
  • 2.8k
  • 15
  • 20
Loading