Do not enforce type of ordered lists upon exporting

* lisp/org-docbook.el (org-export-docbook-list-line): even with
  alphabetical lists, Org shouldn't enforce a particular list type to
  exporters. This is a job for style files.
* lisp/org-html.el (org-html-export-list-line): ib idem.
This commit is contained in:
Nicolas Goaziou 2011-01-18 22:36:49 +01:00
parent 212828c556
commit 4636453e93
2 changed files with 7 additions and 29 deletions

View File

@ -1391,27 +1391,17 @@ the alist of previous items."
;; case list is ill-formed.
(type (funcall get-type list-beg struct prevs))
;; Special variables for ordered lists.
(order-type (let ((bullet (org-list-get-bullet list-beg struct)))
(cond
((not (equal type "ordered")) nil)
((string-match "[a-z]" bullet) "loweralpha")
((string-match "[A-Z]" bullet) "upperalpha")
(t "arabic"))))
(counter (let ((count-tmp (org-list-get-counter pos struct)))
(cond
((not count-tmp) nil)
((and (member order-type '("loweralpha" "upperalpha"))
(string-match "[A-Za-z]" count-tmp))
count-tmp)
((and (equal order-type "arabic")
(string-match "[0-9]+" count-tmp))
((string-match "[A-Za-z]" count-tmp)
(- (string-to-char (upcase count-tmp)) 64))
((string-match "[0-9]+" count-tmp)
count-tmp)))))
;; When FIRSTP, a new list or sub-list is starting.
(when firstp
(org-export-docbook-close-para-maybe)
(insert (if (equal type "ordered")
(concat "<orderedlist numeration=\"" order-type "\">\n")
(format "<%slist>\n" type))))
(insert (format "<%slist>\n" type)))
(insert (cond
((equal type "variable")
(format "<varlistentry><term>%s</term><listitem>" desc-tag))

View File

@ -2446,28 +2446,16 @@ the alist of previous items."
;; Always refer to first item to determine list type, in
;; case list is ill-formed.
(type (funcall get-type list-beg struct prevs))
;; Special variables for ordered lists.
(order-type (let ((bullet (org-list-get-bullet list-beg struct)))
(cond
((not (equal type "o")) nil)
((string-match "[a-z]" bullet) "a")
((string-match "[A-Z]" bullet) "A")
(t "1"))))
(counter (let ((count-tmp (org-list-get-counter pos struct)))
(cond
((not count-tmp) nil)
((and (member order-type '("a" "A"))
(string-match "[A-Za-z]" count-tmp))
((string-match "[A-Za-z]" count-tmp)
(- (string-to-char (upcase count-tmp)) 64))
((and (equal order-type "1")
(string-match "[0-9]+" count-tmp))
((string-match "[0-9]+" count-tmp)
count-tmp)))))
(when firstp
(org-close-par-maybe)
;; Treat ordered lists differently because of ORDER-TYPE.
(insert (if (equal type "o")
(concat "<ol type=\"" order-type "\">\n")
(format "<%sl>\n" type))))
(insert (format "<%sl>\n" type)))
(insert (cond
((equal type "d")
(format "<dt>%s</dt><dd>\n" desc-tag))