Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8399959
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T21:26:32+00:00 2026-06-09T21:26:32+00:00

BACKGROUND I using great htmlize.el to export my org-mode buffer contents with font hi-lock.

  • 0

BACKGROUND

  1. I using great htmlize.el to export my org-mode buffer contents with font hi-lock.
  2. Emacs org-mode has a Link format.

PROBLEM

For Example, here is a org-mode file with contents:

[[http://hunmr.blogspot.com][blog]]

When I Using Htmlize.el to htmlize buffer to HTML contents, The link was missing.
produces HTML like:

<span style="hyperlinkFOOBAR">blog</span>

EXPECTED

I expected it produces clickable link like:

<a style="hyperlinkFOOBAR" href="http://hunmr.blogspot.com">blog</a>

QUESTION

EDIT1 The org-export-as-html can export link, but can not create CSS for the Hi-locks.

  • Do you know other ways to to export org-mode links to HTML?
  • To read the real link in org-mode buffer using elisp, how to do that? read text
    property?

THANKS IN ADVANCE, YOUR HELP WILL BE HIGHLY APPRECIATED.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-09T21:26:33+00:00Added an answer on June 9, 2026 at 9:26 pm

    Thanks for @Andreas ‘s hints, I add following code to htmlize.el. Currently the org-link can be htmlized to clickable link.

    The code was shared on github:

    https://github.com/whunmr/dotemacs/blob/master/site-lisp/htmlize.el

    and

    http://hunmr.blogspot.com/2012/08/enhance-htmlizeel-now-can-export-org.html

    FOLLOWING IS THE MAIN CODE:

    (defun expand-org-link (&optional buffer)
      "Change [[url][shortname]] to [[url] [shortname]] by adding a space between url and shortname"
      (goto-char (point-min))
      (while (re-search-forward "\\[\\[\\([^][]+\\)\\]\\(\\[\\([^][]+\\)\\]\\)?\\]"
                    nil t)
        (let ((url (match-string 1))
          (link-text (match-string 3)))
          (delete-region (match-beginning 0) (match-end 0))
          (insert "[[" url "] [" link-text "]]"))))
    
    (defun shrink-org-link (&optional buffer)
      "Change [[url] [shortname]] to [[url][shortname]], remove the space between url and shortname"
      (goto-char (point-min))
      (while (re-search-forward "\\[\\[\\([^][]+\\)\\] \\(\\[\\([^][]+\\)\\]\\)?\\]"
                    nil t)
        (let ((url (match-string 1))
          (link-text (match-string 3)))
          (delete-region (match-beginning 0) (match-end 0))
          (insert "[[" url "][" link-text "]]"))))
    
    (defun transform-org-link ()
      "transform htmlized <span> to <a>"
      (goto-char (point-min))
      (while (re-search-forward "\\[\\[<span \\([^>]+\\)>\\([^][]+\\)</span>\\] \\[\\([^][]+\\)\\]\\]"
                    nil t)
        (let ((style (match-string 1))
              (url (match-string 2))
          (link-text (match-string 3)))
          (delete-region (match-beginning 0) (match-end 0))
          (insert "<a " style " href=\"" url "\">" link-text "</a>"))))
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm using a custom font and the @font-face tag. In Windows, everything looks great,
I'm using GCD to do some background loading from the internet. This works great
Background: I'm using the middleware django-multihost (http://effbot.org/zone/django-multihost.htm) to allow my single django app to
Background: Using unix, codeigniter from localhost. I'd like to run a controllers via a
Background Using boost and other similar libraries is the easiest way to find compiler
Background: Using jQuery 1.7 client side PHP server side Using json responses with json_encode
Background Using JavaScript, I need to sort a large JSON object based on a
How to make android icons with transparent background using eclipse.I know that we can
I'm trying to set an image as the background using this code: root.setStyle(-fx-background-image: url('splash.jpg');
I'm trying to create a new spinner background using a 9 patch picture. I've

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.