From: Jess Balint <jbalint@gmail.com>
To: emacs-orgmode@gnu.org
Subject: Bug: HTML Export doesn't handle internal link with spaces [8.0.7 (8.0.7-6-g13cb28-elpa @ /home/jbalint/.emacs.d/elpa/org-20130812/)]
Date: Mon, 16 Dec 2013 14:48:03 -0600 [thread overview]
Message-ID: <87zjo034l8.wl%jbalint@gmail.com> (raw)
Remember to cover the basics, that is, what you expected to happen and
what in fact did happen. You don't know how to make a good report? See
http://orgmode.org/manual/Feedback.html#Feedback
Your bug report will be posted to the Org-mode mailing list.
------------------------------------------------------------------------
I've generated a link to a headline with `org-store-link' and
`org-insert-link'. It's rendered into the Org file like so:
[[*Headline%20with%Spaces][Headline with Spaces]]
The HTML export renders this as an italic string (the last cond in the org-html-link function).
The HTML exporter gets a "fuzzy" link which is handled in this block:
;; Links pointing to a headline: Find destination and build
;; appropriate referencing command.
((member type '("custom-id" "fuzzy" "id"))
(let ((destination (if (string= type "fuzzy")
(org-export-resolve-fuzzy-link link info)
(org-export-resolve-id-link link info))))
The problem is in `org-export-resolve-fuzzy-link' which get's the path
directly from the link:
(let* ((raw-path (org-element-property :path link))
But at this point it has "%20" in it which causes a problem when
splitting it:
;; Split PATH at white spaces so matches are space
;; insensitive.
(path (org-split-string
(if match-title-p (substring raw-path 1) raw-path)))
This does nothing because there are no spaces in the string (they are
%20 here). The search for a headline matching this fails. I can solve
this here by doing:
;; Split PATH at white spaces so matches are space
;; insensitive.
(path (org-split-string
(replace-regexp-in-string "%20" " "
(if match-title-p (substring raw-path 1) raw-path))))
I'm not it's the proper solution though. Thanks.
Jess
Emacs : GNU Emacs 24.3.1 (x86_64-unknown-linux-gnu, GTK+ Version 3.8.2)
of 2013-08-06 on -mnt-storage-buildroots-staging-x86_64-eric
Package: Org-mode version 8.0.7 (8.0.7-6-g13cb28-elpa @ /home/jbalint/.emacs.d/elpa/org-20130812/)
current state:
==============
(setq
org-tab-first-hook '(org-hide-block-toggle-maybe
org-src-native-tab-command-maybe
org-babel-hide-result-toggle-maybe
org-babel-header-arg-expand)
org-speed-command-hook '(org-speed-command-default-hook
org-babel-speed-command-hook)
org-occur-hook '(org-first-headline-recenter)
org-metaup-hook '(org-babel-load-in-session-maybe)
org-log-done 'time
org-confirm-shell-link-function 'yes-or-no-p
org-latex-format-headline-function 'org-latex-format-headline-default-function
org-default-notes-file "~/Dropbox/important/org/notes.org"
org-after-todo-state-change-hook '(org-clock-out-if-current)
org-src-mode-hook '(org-src-babel-configure-edit-buffer
org-src-mode-configure-edit-buffer)
org-agenda-before-write-hook '(org-agenda-add-entry-text)
org-babel-pre-tangle-hook '(save-buffer)
org-mode-hook '(#[nil "\300\301\302\303\304$\207"
[org-add-hook change-major-mode-hook
org-show-block-all append local]
5]
#[nil "\300\301\302\303\304$\207"
[org-add-hook change-major-mode-hook
org-babel-show-result-all append local]
5]
org-babel-result-hide-spec org-babel-hide-all-hashes
(lambda nil (local-set-key "\x03a" (quote org-agenda))
(local-unset-key "\x03\x0f")
(local-set-key "\x03\x0f"
(function
(lambda nil (interactive)
(if (oracle-elem-open) nil (org-open-at-point)))
)
)
(org-babel-do-load-languages
(quote org-babel-load-languages) (quote ((ditaa . t))))
)
)
org-ctrl-c-ctrl-c-hook '(org-babel-hash-at-point
org-babel-execute-safely-maybe)
org-directory "~/Dropbox/important/org"
org-cycle-hook '(org-cycle-hide-archived-subtrees org-cycle-hide-drawers
org-cycle-hide-inline-tasks org-cycle-show-empty-lines
org-optimize-window-after-visibility-change)
org-todo-keywords '((sequence "TODO" "|" "DONE")
(sequence "|" "WAITING") (sequence "|" "CANCELED"))
org-confirm-elisp-link-function 'yes-or-no-p
org-metadown-hook '(org-babel-pop-to-session-maybe)
org-babel-load-languages '((ditaa . t))
org-agenda-files '("~/Dropbox/important/org"
"~/Dropbox/important/org/oracle_work_log"
"~/Dropbox/important/org/notes")
org-clock-out-hook '(org-clock-remove-empty-clock-drawer)
org-confirm-babel-evaluate 'my-org-confirm-babel-evaluate
org-src-fontify-natively t
)
next reply other threads:[~2013-12-16 20:45 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-12-16 20:48 Jess Balint [this message]
2013-12-20 21:47 ` Bug: HTML Export doesn't handle internal link with spaces [8.0.7 (8.0.7-6-g13cb28-elpa @ /home/jbalint/.emacs.d/elpa/org-20130812/)] Nicolas Goaziou
2014-01-03 14:48 ` Bastien
2014-01-03 15:05 ` Nicolas Goaziou
2014-01-04 14:35 ` Bastien
2014-01-05 0:03 ` Nicolas Goaziou
2014-01-05 6:45 ` Bastien
2014-01-06 11:32 ` Nicolas Goaziou
2014-01-06 16:36 ` Bastien
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87zjo034l8.wl%jbalint@gmail.com \
--to=jbalint@gmail.com \
--cc=emacs-orgmode@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.