Parcourir la source

Fix 464cd96

* lisp/ox-html.el (org-html-link):
* lisp/ox-md.el (org-md-link): Fix errors introduced in
  464cd965cb916b1ff60754226a3c2cc85b874abf.
Nicolas Goaziou il y a 10 ans
Parent
commit
a526ee3b82
2 fichiers modifiés avec 8 ajouts et 10 suppressions
  1. 3 6
      lisp/ox-html.el
  2. 5 4
      lisp/ox-md.el

+ 3 - 6
lisp/ox-html.el

@@ -2807,12 +2807,9 @@ INFO is a plist holding contextual information.  See
 			(org-element-property :raw-link link) info))))
 	  ;; Link points to a headline.
 	  (headline
-	   (let ((href
-		  ;; Headline linked via CUSTOM_ID.
-		  (or (and (string= type "custom-id")
-			   (org-element-property :CUSTOM_ID destination))
-		      (org-export-get-headline-id destination info)
-		      (t (error "Shouldn't reach here"))))
+	   (let ((href (or (and (string= type "custom-id")
+				(org-element-property :CUSTOM_ID destination))
+			   (org-export-get-headline-id destination info)))
 		 ;; What description to use?
 		 (desc
 		  ;; Case 1: Headline is numbered and LINK has no

+ 5 - 4
lisp/ox-md.el

@@ -355,12 +355,13 @@ a communication channel."
 	  (when destination
 	    (let ((number (org-export-get-ordinal destination info)))
 	      (if number
-		(if (atom number) (number-to-string number)
-		  (mapconcat #'number-to-string number "."))
+		  (if (atom number) (number-to-string number)
+		    (mapconcat #'number-to-string number "."))
 		;; Unnumbered headline.
 		(and (eq 'headline (org-element-type destination))
-		  ;; BUG: shouldn't headlines have a form like [ref](name) in md?
-		  (org-export-data (org-element-property :title headline) info))))))))
+		     ;; BUG: shouldn't headlines have a form like [ref](name) in md?
+		     (org-export-data
+		      (org-element-property :title destination) info))))))))
      ;; Link type is handled by a special function.
      ((let ((protocol (nth 2 (assoc type org-link-protocols))))
 	(and (functionp protocol)