فهرست منبع

ox: Change label naming scheme

* ox.el (org-export-get-reference): Change labeling scheme.

160820bc94 and later changed the label naming scheme to follow types.
This commit maps to types to more standard names, e.g. 'headline' to
'sec'.
Rasmus 10 سال پیش
والد
کامیت
cf7d64f1e4
1فایلهای تغییر یافته به همراه11 افزوده شده و 2 حذف شده
  1. 11 2
      lisp/ox.el

+ 11 - 2
lisp/ox.el

@@ -4149,9 +4149,18 @@ alphanumeric characters only."
 		     h))))
     (or (gethash datum cache)
 	(puthash datum
-		 (format "org%s%d"
+		 (format "%s:%d"
 			 (if type
-			     (replace-regexp-in-string "-" "" (symbol-name type))
+			     (case type
+			       (headline "sec")
+			       (paragraph
+				(if (org-element-property :caption datum)
+				    "fig" "paragraph"))
+			       (latex-environment "eq")
+			       (table "tbl")
+			       (otherwise
+				(replace-regexp-in-string "-" ""
+							  (symbol-name type))))
 			   "secondarystring")
 			 (incf (gethash type cache 0)))
 		 cache))))