I'm using org-mode to write blog post(wordpress).
Because I'm using a plugin for syntax highlighting, I don't need to use org-mode's syntax highlighting.
Here is example.
Source in emacs.
<a href=" " rel="nofollow noreferrer"><img src=" " alt="enter image description here"></a>
Exported output.
<a href=" " rel="nofollow noreferrer"><img src=" " alt="enter image description here"></a>
When I remove language field followed
, syntax highlighting is also disapeared. But I just want to disable syntax highlighting only when exporting without removing language field(emacs-lisp).
Also I tested below, but it does not work.
<strong>============ UPDATE ============</strong>
I applied below. (Thanks @Picaud Vincent)
(setq org-html-htmlize-output-type 'nil)
It works fine with source block without language field. But It does not work with source block with language field.
here is example.
In .emacs file..
(setq org-html-htmlize-output-type 'nil)
<ol>
<li>without language field
origin</li>
</ol>
<div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
<div class="snippet-code">
<pre class="snippet-code-html lang-html prettyprint-override">
</div>
</div>
exported
<div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
<div class="snippet-code">
<pre class="snippet-code-html lang-html prettyprint-override">
</div>
</div>
<ol start="2">
<li>with language field
origin</li>
</ol>
<div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
<div class="snippet-code">
<pre class="snippet-code-html lang-html prettyprint-override">
</div>
</div>
exported
<div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
<div class="snippet-code">
<pre class="snippet-code-html lang-html prettyprint-override">
</div>
</div>
<strong>============ UPDATE ============</strong>
Finally, I found solution.
<ol>
<li>Follow @Picaud Vincent' answer.
nil)`</li>
<li>If There is no code in source block with language field, add
to language field.
ex>
</li>
</ol>
Although adding 'exports: code` disables syntax highlighting in org-mode buffer, but it solve my problem.
Because I'm using a plugin for syntax highlighting, I don't need to use org-mode's syntax highlighting.
Here is example.
Source in emacs.
<a href=" " rel="nofollow noreferrer"><img src=" " alt="enter image description here"></a>
Exported output.
<a href=" " rel="nofollow noreferrer"><img src=" " alt="enter image description here"></a>
When I remove language field followed
Code:
BEGIN_SRC
Also I tested below, but it does not work.
Code:
(setq org-src-fontify-natively t)
<strong>============ UPDATE ============</strong>
I applied below. (Thanks @Picaud Vincent)
(setq org-html-htmlize-output-type 'nil)
It works fine with source block without language field. But It does not work with source block with language field.
here is example.
In .emacs file..
(setq org-html-htmlize-output-type 'nil)
<ol>
<li>without language field
origin</li>
</ol>
<div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
<div class="snippet-code">
<pre class="snippet-code-html lang-html prettyprint-override">
Code:
#+BEGIN_SRC
(setq org-todo-keywords
'((sequence "TODO" "FEEDBACK" "VERIFY" "|" "DONE" "DELEGATED")))
#+END_SRC
</div>
exported
<div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
<div class="snippet-code">
<pre class="snippet-code-html lang-html prettyprint-override">
Code:
<pre class="example">
(setq org-todo-keywords
'((sequence "TODO" "FEEDBACK" "VERIFY" "|" "DONE" "DELEGATED")))
</pre>
</div>
<ol start="2">
<li>with language field
origin</li>
</ol>
<div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
<div class="snippet-code">
<pre class="snippet-code-html lang-html prettyprint-override">
Code:
#+BEGIN_SRC emacs-lisp
(setq org-todo-keywords
'((sequence "TODO" "FEEDBACK" "VERIFY" "|" "DONE" "DELEGATED")))
#+END_SRC
</div>
exported
<div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
<div class="snippet-code">
<pre class="snippet-code-html lang-html prettyprint-override">
Code:
<div class="org-src-container">
<pre class="src src-emacs-lisp"></pre>
</div>
<strong>============ UPDATE ============</strong>
Finally, I found solution.
<ol>
<li>Follow @Picaud Vincent' answer.
Code:
(setq org-html-htmlize-output-type
<li>If There is no code in source block with language field, add
Code:
exports: code
ex>
Code:
#+BEGIN_SRC emacs-lisp:exports code
</ol>
Although adding 'exports: code` disables syntax highlighting in org-mode buffer, but it solve my problem.