diff --git a/ox-blackfriday.el b/ox-blackfriday.el index 67efcc6..b72ae50 100644 --- a/ox-blackfriday.el +++ b/ox-blackfriday.el @@ -705,27 +705,20 @@ This function is adapted from `org-html-special-block'." ;; #+end_summary ;; Here are the details. ;; #+end_details - (setq contents - (let* (;; A closing
tag is added at the end.. the - ;; openingtag for that is later added in - ;; the `str2' var. Insert a newline before - ;; that tag for the reason explained below - ;; using the emacs-lisp Markdown code block. - (str1 (concat contents "\n
")) - ;; Detect the summary closing tag "". - ;; If found, add the opening tag with
- ;; "details" class after that, so that CSS
- ;; rules can be set specific to the details
- ;; portion using "details .details".
- (str2 (replace-regexp-in-string
- "
" - str1)) - (has-summary (not (string= str1 str2)))) - ;; (message "[DBG details/summary]: is-open:%S `%s' `%s'" is-open str1 str2) - (unless has-summary - (setq str2 (concat "
" str1))) - str2)) + (let ((p-open "
"))
+ (setq contents
+ (concat
+ ;; Wrap the "details" portion in the .. \\(?:.\\|\n\\)*
\\)" contents) ;If summary exists
+ (replace-match (format "\\1\n%s" p-open) nil nil contents 1)
+ (concat p-open contents))
+ ;; A newline is inserted before the closing