Hello,

Yujie Wen <yjwen...@gmail.com> writes:

>   I am working on the org-reveal exporter and I need to convert a string
> get from org-element-property into HTML format. The property string have
> some Org-mode markups that need to be converted to relevant HTML labels.
> For example, a string of "/italic/" to "<i>italic</i>"
>
>   Is there any existing Org-mode functions can help me to achieve this kind
> of functionality?

For interactive functions, you can use `org-export-string-as'. E.g.,

  (org-export-string-as "/italic/" 'html 'body-only)

If you don't want the surronding paragraph, you can use the same
function with an anonymous export back-end derived from HTML:

  (org-export-string-as "/italic/"
                      (org-export-create-backend
                       :parent 'html
                       :transcoders '((paragraph . (lambda (e c i) c))))
                      'body-only)

But, from within an export back-end, there are probably other ways that
will not require to collect export options again. E.g,

  (org-export-data-with-backend
   (org-element-parse-secondary-string
    "/italic/" org-element-all-successors)
   'html info)


Regards,

-- 
Nicolas Goaziou

Reply via email to