emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* Bug: Extra blank line in subitem list when exported to markdown [8.3.1 (8.3.1-103-g366dc4-elpa @ /home/bitouze/.emacs.d/elpa/org-20150907/)]
@ 2015-09-12 14:57 Denis Bitouzé
  2015-09-13 20:41 ` Nicolas Goaziou
  0 siblings, 1 reply; 5+ messages in thread
From: Denis Bitouzé @ 2015-09-12 14:57 UTC (permalink / raw)
  To: emacs-orgmode



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.
------------------------------------------------------------------------

When exported to markdown, an extra blank line is added in subitem
lists, as shown by the following minimal example.

#+NAME: test.org
#+begin_src org
- Foo 1
- Foo2:
  - Foo21
  - Foo22
  End of Foo2 item.
#+end_src

*Expected* behavior (note the *absence* of blank line after =Foo22=):

#+NAME: test-ok.md
#+begin_src markdown
-   Foo 1
-   Foo2:
    -   Foo21
    -   Foo22
    End of Foo2 item.
#+end_src

*Current* behavior (note the blank line after =Foo22=):

#+NAME: test.md
#+begin_src markdown
-   Foo 1
-   Foo2:
    -   Foo21
    -   Foo22
    
    End of Foo2 item.
#+end_src

This last =.md= code is interpreted by markdown engines as the following
crazy =.html= code:

#+begin_src html
<ul>
<li>Foo 1</li>
<li>
<ul>
<li>Foo21</li>
<li>Foo22</li>
</ul>
<p>Foo2:</p>
<p>End of Foo2 item.</p>
</li>
</ul>
#+end_src

Emacs  : GNU Emacs 24.5.1 (i686-pc-linux-gnu, GTK+ Version 3.14.8)
 of 2015-06-29 on drums.chezmoi.fr
Package: Org-mode version 8.3.1 (8.3.1-103-g366dc4-elpa @ /home/bitouze/.emacs.d/elpa/org-20150907/)

current state:
==============
(setq
 org-entities-user '(("nok" "{\\color{red}\\ding{55}}" nil "<font
 color='red'>&#x2718;</font>" "NOK"
                      "NOK" "✘")
                     ("ok" "{\\color{checkmark}\\ding{51}}" nil "<font
 color='green'>&#x2714;</font>"
                      "OK" "OK" "✔")
                     )
 org-enforce-todo-checkbox-dependencies t
 org-inlinetask-default-state "TODO"
 org-agenda-search-view-always-boolean t
 org-agenda-log-mode-items '(clock)
 org-latex-format-headline-function 'leuven--org-latex-format-headline
 org-ctrl-c-ctrl-c-hook '(org-babel-hash-at-point org-babel-execute-safely-maybe)
 org-pretty-entities t
 org-latex-packages-alist '(("" "listings") ("" "xcolor") ("french" "babel"))
 org-html-format-inlinetask-function 'org-html-format-inlinetask-default-function
 org-stuck-projects '("+LEVEL=2/-DONE" ("TODO" "STRT") nil "")
 org-refile-use-cache t
 org-clock-in-resume t
 org-clock-out-when-done nil
 org-log-states-order-reversed nil
 org-odt-preferred-output-format "doc"
 org-agenda-sticky t
 org-goto-interface 'outline-path-completion
 outline-minor-mode-hook '(leuven--outline-minor-mode-hook
                           (lambda nil
                            (if (and outline-minor-mode (derived-mode-p (quote
                                                                         emacs-lisp-mode)))
                             (progn (hide-sublevels 1000)))
                            )
                           )
 org-agenda-skip-scheduled-if-done t
 org-ellipsis " ►"
 org-clock-persist t
 org-archive-location "::* Archive"
 org-agenda-window-setup 'current-window
 org-adapt-indentation nil
 org-agenda-entry-text-leaders "               │ "
 org-agenda-scheduled-leaders '("Scheduled  " "           ")
 org-clock-mode-line-total 'all
 org-tab-first-hook '(org-hide-block-toggle-maybe
                      org-babel-hide-result-toggle-maybe
                      org-babel-header-arg-expand)
 org-agenda-exporter-settings '((ps-number-of-columns 1) (ps-landscape-mode t)
                                (htmlize-output-type (quote css)))
 org-archive-hook '(org-attach-archive-delete-maybe)
 org-refile-targets '((nil :maxlevel . 4) (nil :maxlevel . 2))
 org-html-htmlize-output-type 'css
 org-modules '(org-info org-habit org-gnus org-id org-checklist)
 org-cycle-hook '(org-inlinetask-hide-tasks org-cycle-hide-archived-subtrees
                  org-cycle-hide-drawers
                  org-cycle-show-empty-lines org-optimize-window-after-visibility-change)
 org-html-checkbox-type 'unicode
 org-mime-send-subtree-hook '((lambda nil
                               (org-entry-put (point) "mail_composed"
                                (current-time-string)))
                              )
 org-agenda-before-write-hook '(org-agenda-add-entry-text)
 org-confirm-babel-evaluate nil
 org-speed-command-hook '(org-speed-command-default-hook org-babel-speed-command-hook)
 org-src-window-setup 'current-window
 org-ascii-format-inlinetask-function 'org-ascii-format-inlinetask-default
 org-export-preprocess-hook '(leuven--org-export-preprocess-hook)
 org-clock-total-time-cell-format "%s"
 org-export-snippet-translation-alist '(("b" . "beamer") ("l" . "latex") ("h" . "html"))
 org-agenda-current-time-string "Right now"
 org-blocker-hook '(org-block-todo-from-checkboxes org-block-todo-from-children-or-siblings-or-parent)
 org-fontify-done-headline t
 org-agenda-skip-deadline-prewarning-if-scheduled 7
 org-agenda-restore-windows-after-quit t
 org-return-follows-link t
 org-babel-pre-tangle-hook '(save-buffer)
 org-agenda-diary-file "~/org/diary.org"
 org-export-time-stamp-file nil
 org-occur-hook '(org-first-headline-recenter)
 org-emphasis-alist '(("*" bold "<b>" "</b>") ("/" italic "<i>" "</i>")
                      ("_" underline "<span
 style=\"text-decoration:underline;\">" "</span>")
                      ("=" org-verbatim "<code>" "</code>" verbatim)
                      ("~" org-code "<code>" "</code>" verbatim))
 org-font-lock-hook '(org-inlinetask-fontify)
 org-agenda-auto-exclude-function 'leuven--org-auto-exclude-function
 org-refile-target-verify-function 'bh/verify-refile-target
 org-speed-commands-user '(("y" org-todo-yesterday "DONE") ("d" org-todo "DONE"))
 org-src-lang-modes '(("dot" . graphviz-dot) ("ocaml" . tuareg) ("elisp"
                                                                 . emacs-lisp)
                      ("ditaa" . artist) ("asymptote" . asy) ("dot"
                                                              . fundamental) ("sqlite" . sql)
                      ("calc" . fundamental) ("C" . c) ("cpp" . c++) ("C++"
                                                                      . c++)
                      ("screen" . shell-script) ("shell" . sh) ("bash" . sh))
 org-log-redeadline 'time
 org-clock-history-length 35
 org-deadline-warning-days 7
 org-html-format-headline-function 'org-html-format-headline-default-function
 org-structure-template-alist '(("E" "\\begin{equation}\n?\n\\end{equation}" "")
                                ("C" "#+begin_comment\n?\n#+end_comment")
                                ("t" "#+begin_tip\n?\n#+end_tip")
                                ("w" "#+begin_warning\n?\n#+end_warning")
                                ("n" "#+begin_note\n?\n#+end_note") ("s"
                                                                     "#+begin_src ?\n\n#+end_src")
                                ("e" "#+begin_example\n?\n#+end_example")
                                ("q" "#+begin_quote\n?\n#+end_quote")
                                ("v" "#+begin_verse\n?\n#+end_verse")
                                ("V" "#+begin_verbatim\n?\n#+end_verbatim")
                                ("c" "#+begin_center\n?\n#+end_center")
                                ("l" "#+begin_latex\n?\n#+end_latex") ("L"
                                                                       "#+latex: ")
                                ("h" "#+begin_html\n?\n#+end_html") ("H"
                                                                     "#+html: ")
                                ("a" "#+begin_ascii\n?\n#+end_ascii") ("A"
                                                                       "#+ascii: ")
                                ("i" "#+index: ?") ("I" "#+include: %file ?"))
 org-export-with-sub-superscripts '{}
 org-use-sub-superscripts '{}
 org-refile-allow-creating-parent-nodes 'confirm
 org-clock-out-remove-zero-time-clocks t
 org-agenda-skip-timestamp-if-done t
 org-metaup-hook '(org-babel-load-in-session-maybe)
 org-reveal-start-hook '(org-decrypt-entry)
 org-confirm-elisp-link-function 'yes-or-no-p
 org-clock-file-time-cell-format "%s"
 org-fast-tag-selection-single-key t
 org-id-link-to-org-use-id 'create-if-interactive-and-no-custom-id
 org-cycle-include-plain-lists nil
 org-agenda-sorting-strategy '((agenda time-up category-up priority-down
                                effort-down)
                               (todo category-up priority-down effort-down)
                               (tags category-up priority-down effort-down) (search category-up))
 org-log-into-drawer t
 org-tag-faces '(("refile" (:slant italic :foreground "#A9876E"))
                 ("personal" (:slant italic :foreground "#5C88D3"))
                 ("work" (:slant italic :foreground "#699761"))
                 ("FLAGGED" (:weight bold :slant italic :foreground
                             "white" :background "#DB2D27"))
                 ("now" (:slant italic :foreground "#000000"))
                 ("notbillable" (:slant italic :foreground "#8774AF")))
 org-publish-list-skipped-files nil
 org-default-notes-file "~/org/notes.org"
 org-columns-default-format "%60ITEM(Details) %5PRIORITY(Prio) %14SCHEDULED(Scheduled) %15TAGS(Context) %7TODO(To Do) %6CLOCKSUM(Clock) %5Effort(Effort){:} "
 org-priority-faces '((65 :weight bold :foreground "#5F3731" :background
                       "#EFC4C0")
                      (66 :foreground "#475443" :background "#D5E1D0")
                      (67 :foreground "#2D373F" :background "#C9DBE3"))
 org-latex-format-drawer-function '(lambda (name contents) contents)
 org-babel-after-execute-hook '(org-display-inline-images)
 org-agenda-block-separator #("____________________________________________________________________________________________________________________________________" 0 132 (face (:foreground "#59ACE2")))
 org-src-tab-acts-natively t
 org-agenda-span 'day
 org-habit-show-habits-only-for-today nil
 org-hide-macro-markers t
 org-export-backends '(ascii html icalendar latex odt md)
 org-agenda-format-date "%Y-%m-%d %a                                                                  _"
 org-refile-use-outline-path 'file
 org-blank-before-new-entry '((heading . t) (plain-list-item . auto))
 org-agenda-dim-blocked-tasks nil
 org-agenda-deadline-faces '((1.0001 . leuven-org-deadline-overdue)
                             (0.9999 . leuven-org-deadline-today)
                             (0.8571 . leuven-org-deadline-tomorrow)
                             (0.0 . leuven-org-deadline-future))
 outline-minor-mode-prefix "\x0f"
 org-treat-S-cursor-todo-selection-as-state-change nil
 org-tag-alist '((:startgroup) ("personal" . 112) ("work" . 119) (:endgroup)
                 ("call" . 99)
                 ("errands" . 101) ("finance" . 102) ("mail" . 109)
                 ("notbillable" . 66)
                 ("ARCHIVE" . 97) ("crypt" . 67) ("FLAGGED" . 63))
 org-agenda-persistent-filter t
 org-global-properties '(("Effort_ALL" . "0 0:10 0:30 1:00 2:00 3:00 4:00 5:00 6:00 8:00"))
 org-highlight-latex-and-related '(latex script entities)
 org-clock-out-hook '(org-clock-remove-empty-clock-drawer)
 org-link-abbrev-alist '(("cache" . "http://www.google.com/search?q=cache:%s")
                         ("dictionary" .
                          "http://www.dict.org/bin/Dict?Database=*&Form=Dict1&Strategy=*&Query=%s")
                         ("google" . "http://www.google.com/search?q=%s")
                         ("googlegroups"
                          . "http://groups.google.com/groups?q=%s")
                         ("googlemaps" . "http://maps.google.com/maps?q=%s")
                         ("imdb" . "http://us.imdb.com/Title?%s")
                         ("openstreetmap"
                          . "http://nominatim.openstreetmap.org/search?q=%s&polygon=1")
                         ("wpen" . "http://en.wikipedia.org/wiki/%s")
                         ("wpfr" . "http://fr.wikipedia.org/wiki/%s"))
 org-agenda-prefix-format '((agenda . " %-11s%i %?-12t") (timeline . " % s")
                            (todo . " %i %-12:c")
                            (tags . " %i %-12:c") (search . " %i %-12:c"))
 org-image-actual-width '(320)
 org-latex-default-figure-position "!htbp"
 org-use-speed-commands t
 org-agenda-skip-deadline-if-done t
 org-export-before-parsing-hook '(leuven--change-pdflatex-packages leuven--change-pdflatex-program)
 org-list-description-max-indent 3
 org-enforce-todo-dependencies t
 org-mode-hook '(org-clock-load (lambda nil (local-set-key (kbd "C-c m")
                                             (function org-mime-subtree)))
                 #[nil "\300\301\302\303\304$\207"
                   [org-add-hook before-save-hook org-encrypt-entries nil t] 5]
                 #[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
                 leuven--org-add-electric-pairs
                 leuven--org-switch-dictionary
                 (lambda nil (require (quote org-clock)) (setq org-clock-persist
                                                          t)
                  (org-clock-persistence-insinuate))
                 (lambda nil (local-set-key (kbd "C-M-n") (function
                                                           outline-next-visible-heading))
                  (local-set-key (kbd "C-M-p") (function
                                                outline-previous-visible-heading))
                  (local-set-key (kbd "C-M-u") (function outline-up-heading)))
                 (lambda nil (local-set-key (kbd "C-M-w") (function
                                                           org-table-copy-region))
                  (local-set-key (kbd "C-M-y") (function
                                                org-table-paste-rectangle))
                  (local-unset-key (kbd "C-c SPC")) (local-unset-key (kbd "C-c
 C-<")))
                 fci-mode
                 (lambda nil
                  (if
                   (or (eq (aref (buffer-name) 0) 32)
                    (and (boundp (quote org-babel-exp-reference-buffer))
                     org-babel-exp-reference-buffer)
                    )
                   (message "DON'T TURN ON Flyspell mode in `%s'" (buffer-name))
                   (message "Turn on Flyspell mode in `%s'" (buffer-name))
                   (flyspell-mode))
                  )
                 org-src-block-check)
 org-time-clocksum-format '(:hours "%d" :require-hours t :minutes ":%02d" :require-minutes t)
 org-agenda-clockreport-parameter-plist '(:link t :maxlevel 3 :fileskip0 t)
 org-insert-mode-line-in-empty-file t
 org-export-with-smart-quotes t
 org-special-ctrl-a/e 'reversed
 org-startup-with-inline-images t
 org-agenda-start-on-weekday nil
 org-latex-pdf-process '("latexmk --version" "latexmk -cd -f -pdf -pdflatex=pdflatex %f && latexmk -c")
 org-table-export-default-format "orgtbl-to-csv"
 org-agenda-mode-hook '((lambda nil (local-set-key (kbd "C-c m") (function leuven-mail-subtree))))
 org-habit-today-glyph 9483
 org-ascii-format-drawer-function '(lambda (name contents width) contents)
 org-tags-exclude-from-inheritance '("crypt")
 org-babel-results-keyword "results"
 org-odt-format-drawer-function '(lambda (name contents) contents)
 org-clock-idle-time 120
 org-agenda-inhibit-startup t
 org-agenda-skip-scheduled-if-deadline-is-shown t
 org-show-context-detail '((occur-tree . minimal) (tags-tree . minimal) (isearch
                                                                         . lineage)
                           (bookmark-jump . lineage) (default . ancestors))
 org-gnus-prefer-web-links t
 org-latex-listings t
 org-finalize-agenda-hook '(org-agenda-to-appt
                            (lambda nil
                             (let ((inhibit-read-only t)) (goto-char
                                                           (point-min))
                              (org-do-emphasis-faces (point-max)))
                             )
                            (lambda nil
                             (remove-text-properties (point-min) (point-max)
                              (quote (mouse-face t))))
                            leuven--org-agenda-right-justify-tags)
 org-read-date-prefer-future 'time
 org-time-stamp-rounding-minutes '(1 1)
 org-export-allow-bind-keywords t
 org-html-format-drawer-function '(lambda (name contents) contents)
 org-src-preserve-indentation t
 org-loop-over-headlines-in-active-region 'start-level
 org-open-non-existing-files t
 org-babel-no-eval-on-ctrl-c-ctrl-c t
 org-export-with-priority t
 org-tags-column -80
 org-latex-image-default-width ".75\\linewidth"
 org-hide-emphasis-markers t
 org-clock-in-switch-to-state 'leuven--org-switch-to-started
 org-odt-format-headline-function 'org-odt-format-headline-default-function
 org-latex-link-with-unknown-path-format "\\colorbox{red}{%s}"
 org-metadown-hook '(org-babel-pop-to-session-maybe)
 org-todo-keywords '((sequence "NEW(n!)" "TODO(t!)" "STRT(s!)" "WAIT(w!)"
                      "SDAY(y!)" "|" "DONE(d!)"
                      "CANX(x!)")
                     (sequence "QTE(q!)" "QTD(Q!)" "|" "APP(A!)" "REJ(R!)")
                     (sequence "OPENPO(O!)" "|" "CLSDPO(C!)"))
 org-startup-folded nil
 org-habit-completed-glyph 10004
 org-agenda-time-grid '((daily remove-match) "" (800 1000 1200 1400 1600 1800 2000))
 org-clock-in-prepare-hook '(leuven--org-ask-effort)
 org-clock-display-default-range 'untilnow
 org-todo-repeat-to-state "TODO"
 org-agenda-search-headline-for-time nil
 org-agenda-finalize-hook '(org-agenda-to-appt
                            (lambda nil
                             (let ((inhibit-read-only t)) (goto-char
                                                           (point-min))
                              (org-do-emphasis-faces (point-max)))
                             )
                            (lambda nil
                             (remove-text-properties (point-min) (point-max)
                              (quote (mouse-face t))))
                            leuven--org-agenda-right-justify-tags)
 org-list-allow-alphabetical t
 org-fontify-whole-heading-line t
 org-clock-report-include-clocking-task t
 org-clock-sound "~/Public/Music/Sounds/alarm.wav"
 org-src-mode-hook '(org-src-babel-configure-edit-buffer org-src-mode-configure-edit-buffer)
 org-after-todo-state-change-hook '(org-clock-out-if-current)
 org-html-head-include-scripts nil
 org-url-hexify-p nil
 org-odt-format-inlinetask-function 'org-odt-format-inlinetask-default-function
 org-babel-tangle-lang-exts '(("awk" . "awk") ("java" . "java") ("latex"
                                                                 . "tex") ("python" . "py")
                              ("emacs-lisp" . "el") ("elisp" . "el"))
 org-todo-keyword-faces '(("NEW" . leuven-org-created-kwd) ("TODO" . org-todo)
                          ("STRT" . leuven-org-in-progress-kwd) ("WAIT"
                                                                 . leuven-org-waiting-for-kwd)
                          ("SDAY" . leuven-org-someday-kwd) ("DONE" . org-done)
                          ("CANX" . org-done)
                          ("QTE" . leuven-org-quote-kwd) ("QTD"
                                                          . leuven-org-quoted-kwd)
                          ("APP" . leuven-org-approved-kwd) ("REJ"
                                                             . leuven-org-rejected-kwd)
                          ("OPENPO" . leuven-org-openpo-kwd) ("CLSDPO" . leuven-org-closedpo-kwd))
 org-babel-load-languages '((sql . t) (shell . t) (python . t) (org . t)
                            (makefile . t) (ledger . t)
                            (latex . t) (java . t) (dot . t) (ditaa . t) (awk
                                                                          . t) (R . t)
                            (emacs-lisp . t))
 org-babel-R-command "R --slave --no-save --ess --encoding=UTF-8"
 org-agenda-deadline-leaders '("Deadline   " "In %d d" "%d d ago")
 org-agenda-tags-todo-honor-ignore-options t
 org-latex-format-inlinetask-function 'org-latex-format-inlinetask-default-function
 org-after-todo-statistics-hook '(leuven--org-summary-todo)
 org-fontify-quote-and-verse-blocks t
 org-confirm-shell-link-function 'yes-or-no-p
 org-agenda-clock-consistency-checks '(:max-duration "10:00" :min-duration
                                       0 :max-gap "0:00"
                                       :gap-ok-around ("4:00") :default-face
                                       ((:weight bold :box (:line-width 1 :color
                                                            "#AAEE77")
                                         :foreground "black" :background
                                         "#BFFA9E")
                                        )
                                       :gap-face
                                       ((:weight bold :box (:line-width 1 :color
                                                            "#BBDDFF")
                                         :foreground "black" :background
                                         "#D0EDFF")
                                        )
                                       )
 )
-- 
Denis

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Bug: Extra blank line in subitem list when exported to markdown [8.3.1 (8.3.1-103-g366dc4-elpa @ /home/bitouze/.emacs.d/elpa/org-20150907/)]
  2015-09-12 14:57 Bug: Extra blank line in subitem list when exported to markdown [8.3.1 (8.3.1-103-g366dc4-elpa @ /home/bitouze/.emacs.d/elpa/org-20150907/)] Denis Bitouzé
@ 2015-09-13 20:41 ` Nicolas Goaziou
       [not found]   ` <8737yiuk62.fsf-Gpy5sJQTEQHwkn9pgDnJRVAUjnlXr6A1@public.gmane.org>
  0 siblings, 1 reply; 5+ messages in thread
From: Nicolas Goaziou @ 2015-09-13 20:41 UTC (permalink / raw)
  To: Denis Bitouzé; +Cc: emacs-orgmode

Hello,

dbitouze@wanadoo.fr (Denis Bitouzé) writes:

> When exported to markdown, an extra blank line is added in subitem
> lists, as shown by the following minimal example.
>
> #+NAME: test.org
> #+begin_src org
> - Foo 1
> - Foo2:
>   - Foo21
>   - Foo22
>   End of Foo2 item.
> #+end_src
>
> *Expected* behavior (note the *absence* of blank line after =Foo22=):
>
> #+NAME: test-ok.md
> #+begin_src markdown
> -   Foo 1
> -   Foo2:
>     -   Foo21
>     -   Foo22
>     End of Foo2 item.
> #+end_src
>
> *Current* behavior (note the blank line after =Foo22=):
>
> #+NAME: test.md
> #+begin_src markdown
> -   Foo 1
> -   Foo2:
>     -   Foo21
>     -   Foo22
>     
>     End of Foo2 item.
> #+end_src

Well, the rules governing blank lines in Mardown are mysterious to me.
They are also, AFAIK, totally undocumented.

Anyway, you are suggesting to remove any blank line before paragraphs
following a plain list, but only when they are already contained within
a list. In other words, both

  - Foo 1
  - Foo 2

  A paragraph

and

  - Foo 1
  - Foo 2:
    - Foo 21
    - Foo 22
    End of Foo2 item.

are valid examples. Am I correct? 

Also, what about other block types, e.g., which one is valid:

  - Foo 1
  - Foo2:
    - Foo 21
    - Foo 22

    #+begin_example
    Some example
    #+end_example

or

  - Foo 1
  - Foo2:
    - Foo 21
    - Foo 22
    #+begin_example
    Some example
    #+end_example

?


Regards,

-- 
Nicolas Goaziou

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Bug: Extra blank line in subitem list when exported to markdown [8.3.1 (8.3.1-103-g366dc4-elpa @ /home/bitouze/.emacs.d/elpa/org-20150907/)]
       [not found]   ` <8737yiuk62.fsf-Gpy5sJQTEQHwkn9pgDnJRVAUjnlXr6A1@public.gmane.org>
@ 2015-09-14  7:32     ` Denis Bitouzé
  2015-09-16 12:51       ` Nicolas Goaziou
  0 siblings, 1 reply; 5+ messages in thread
From: Denis Bitouzé @ 2015-09-14  7:32 UTC (permalink / raw)
  To: emacs-orgmode-mXXj517/zsQ

Le 13/09/15 à 22h41, Nicolas Goaziou <mail-Gpy5sJQTEQHwkn9pgDnJRVAUjnlXr6A1@public.gmane.org> a écrit :

> Hello,

Hello,

> dbitouze-39ZsbGIQGT5GWvitb5QawA@public.gmane.org (Denis Bitouzé) writes:
>
>> When exported to markdown, an extra blank line is added in subitem
>> lists, as shown by the following minimal example.
>>
>> #+NAME: test.org
>> #+begin_src org
>> - Foo 1
>> - Foo2:
>>   - Foo21
>>   - Foo22
>>   End of Foo2 item.
>> #+end_src
>>
>> *Expected* behavior (note the *absence* of blank line after =Foo22=):
>>
>> #+NAME: test-ok.md
>> #+begin_src markdown
>> -   Foo 1
>> -   Foo2:
>>     -   Foo21
>>     -   Foo22
>>     End of Foo2 item.
>> #+end_src
>>
>> *Current* behavior (note the blank line after =Foo22=):
>>
>> #+NAME: test.md
>> #+begin_src markdown
>> -   Foo 1
>> -   Foo2:
>>     -   Foo21
>>     -   Foo22
>>     
>>     End of Foo2 item.
>> #+end_src
>
> Well, the rules governing blank lines in Mardown are mysterious to me.
> They are also, AFAIK, totally undocumented.

I agree.

> Anyway, you are suggesting to remove any blank line before paragraphs
> following a plain list, but only when they are already contained
> within a list.

Well, please, don't trust me too quickly :) I must admit I'm very far
from a mardown expert: I'm only a very occasional user.

> In other words, both
>
>   - Foo 1
>   - Foo 2
>
>   A paragraph
>
> and
>
>   - Foo 1
>   - Foo 2:
>     - Foo 21
>     - Foo 22
>     End of Foo 2 item.
>
> are valid examples. Am I correct? 

In fact, my suggestion was wrong: AFAICS, the last example doesn't give
the expected HTML result neither and the less bad solution for nested
lists in markdown seems to be:

#+NAME: test.md
#+begin_src markdown
-   Foo 1

-   Foo 2:

    -   Foo 21
    -   Foo 22

    End of Foo 2 item.
#+end_src

which is interpreted as (rather ugly):

#+begin_src html
<ul>
  <li>
    <p>Foo 1:</p>
  </li>
  <li>
    <p>Foo 2:</p>
    <ul>
      <li>Foo 21</li>
      <li>Foo 22</li>
    </ul>
    <p>End of Foo 2 item.</p>
  </li>
</ul>
#+end_src

> Also, what about other block types, e.g., which one is valid:
>
>   - Foo 1
>   - Foo 2:
>     - Foo 21
>     - Foo 22
>
>     #+begin_example
>     Some example
>     #+end_example
>
> or
>
>   - Foo 1
>   - Foo 2:
>     - Foo 21
>     - Foo 22
>     #+begin_example
>     Some example
>     #+end_example

I'm not sure to understand what you have in mind: are these last two
examples at org mode level?

Regards,
-- 
Denis

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Bug: Extra blank line in subitem list when exported to markdown [8.3.1 (8.3.1-103-g366dc4-elpa @ /home/bitouze/.emacs.d/elpa/org-20150907/)]
  2015-09-14  7:32     ` Denis Bitouzé
@ 2015-09-16 12:51       ` Nicolas Goaziou
       [not found]         ` <87h9muwmr8.fsf-Gpy5sJQTEQHwkn9pgDnJRVAUjnlXr6A1@public.gmane.org>
  0 siblings, 1 reply; 5+ messages in thread
From: Nicolas Goaziou @ 2015-09-16 12:51 UTC (permalink / raw)
  To: Denis Bitouzé; +Cc: public-emacs-orgmode-mXXj517/zsQ



Denis Bitouzé <dbitouze-39ZsbGIQGT5GWvitb5QawA@public.gmane.org> writes:

> Well, please, don't trust me too quickly :) I must admit I'm very far
> from a mardown expert: I'm only a very occasional user.

I never use markdown myself. Between the two of us, you are de facto the
expert.

> In fact, my suggestion was wrong: AFAICS, the last example doesn't give
> the expected HTML result neither and the less bad solution for nested
> lists in markdown seems to be:
>
> #+NAME: test.md
> #+begin_src markdown
> -   Foo 1
>
> -   Foo 2:
>
>     -   Foo 21
>     -   Foo 22
>
>     End of Foo 2 item.
> #+end_src
>
> which is interpreted as (rather ugly):
>
> #+begin_src html
> <ul>
>   <li>
>     <p>Foo 1:</p>
>   </li>
>   <li>
>     <p>Foo 2:</p>
>     <ul>
>       <li>Foo 21</li>
>       <li>Foo 22</li>
>     </ul>
>     <p>End of Foo 2 item.</p>
>   </li>
> </ul>
> #+end_src

This is problematic. There is a rule in "ox-md" that contradicts what
you are suggesting. From org-md-separate-elements's docstring:

  2. In an item, remove any blank line before the very first
     paragraph and the next sub-list.

As a consequence, we try hard to produce

  -   Foo 2:
      -   Foo 21
      -   Foo 22

instead of

  -   Foo 2:

      -   Foo 21
      -   Foo 22

which was the case in early versions of Markdown exporter. I guess we
should produce the latter only when the sub-list is followed by another
block element, e.g., "End of Foo 2 item".

WDYT?

>> Also, what about other block types, e.g., which one is valid:
>>
>>   - Foo 1
>>   - Foo 2:
>>     - Foo 21
>>     - Foo 22
>>
>>     #+begin_example
>>     Some example
>>     #+end_example
>>
>> or
>>
>>   - Foo 1
>>   - Foo 2:
>>     - Foo 21
>>     - Foo 22
>>     #+begin_example
>>     Some example
>>     #+end_example
>
> I'm not sure to understand what you have in mind: are these last two
> examples at org mode level?

I'm trying to generalize the rule. Your previous suggestion applied to
paragraphs. I wondered if it was the same with other block types, e.g.,
example blocks.

Regards,

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Bug: Extra blank line in subitem list when exported to markdown [8.3.1 (8.3.1-103-g366dc4-elpa @ /home/bitouze/.emacs.d/elpa/org-20150907/)]
       [not found]         ` <87h9muwmr8.fsf-Gpy5sJQTEQHwkn9pgDnJRVAUjnlXr6A1@public.gmane.org>
@ 2015-09-16 18:03           ` Denis Bitouzé
  0 siblings, 0 replies; 5+ messages in thread
From: Denis Bitouzé @ 2015-09-16 18:03 UTC (permalink / raw)
  To: Nicolas Goaziou
  Cc: Denis Bitouzé,
	public-emacs-orgmode-mXXj517/zsQ-wOFGN7rlS/M9smdsby/KFg



Le 16/09/15 à 14h51, Nicolas Goaziou <mail-Gpy5sJQTEQHwkn9pgDnJRVAUjnlXr6A1@public.gmane.org> a écrit :

> Denis Bitouzé <dbitouze-39ZsbGIQGT5GWvitb5QawA-XMD5yJDbdMReXY1tMh2IBg@public.gmane.org> writes:
>
>> Well, please, don't trust me too quickly :) I must admit I'm very far
>> from a mardown expert: I'm only a very occasional user.
>
> I never use markdown myself. Between the two of us, you are de facto
> the expert.

;)

>> In fact, my suggestion was wrong: AFAICS, the last example doesn't give
>> the expected HTML result neither and the less bad solution for nested
>> lists in markdown seems to be:
>>
>> #+NAME: test.md
>> #+begin_src markdown
>> -   Foo 1
>>
>> -   Foo 2:
>>
>>     -   Foo 21
>>     -   Foo 22
>>
>>     End of Foo 2 item.
>> #+end_src
>>
>> which is interpreted as (rather ugly):
>>
>> #+begin_src html
>> <ul>
>>   <li>
>>     <p>Foo 1:</p>
>>   </li>
>>   <li>
>>     <p>Foo 2:</p>
>>     <ul>
>>       <li>Foo 21</li>
>>       <li>Foo 22</li>
>>     </ul>
>>     <p>End of Foo 2 item.</p>
>>   </li>
>> </ul>
>> #+end_src
>
> This is problematic. There is a rule in "ox-md" that contradicts what
> you are suggesting. From org-md-separate-elements's docstring:
>
>   2. In an item, remove any blank line before the very first
>      paragraph and the next sub-list.
>
> As a consequence, we try hard to produce
>
>   -   Foo 2:
>       -   Foo 21
>       -   Foo 22
>
> instead of
>
>   -   Foo 2:
>
>       -   Foo 21
>       -   Foo 22
>
> which was the case in early versions of Markdown exporter. I guess we
> should produce the latter only when the sub-list is followed by another
> block element, e.g., "End of Foo 2 item".
>
> WDYT?

Indeed but maybe my usecase is too specific for consuming time on it...

>>> Also, what about other block types, e.g., which one is valid:
>>>
>>>   - Foo 1
>>>   - Foo 2:
>>>     - Foo 21
>>>     - Foo 22
>>>
>>>     #+begin_example
>>>     Some example
>>>     #+end_example
>>>
>>> or
>>>
>>>   - Foo 1
>>>   - Foo 2:
>>>     - Foo 21
>>>     - Foo 22
>>>     #+begin_example
>>>     Some example
>>>     #+end_example
>>
>> I'm not sure to understand what you have in mind: are these last two
>> examples at org mode level?
>
> I'm trying to generalize the rule. Your previous suggestion applied to
> paragraphs. I wondered if it was the same with other block types, e.g.,
> example blocks.

Indeed, this a problem as the Markdown export will put "Some example" on
a separate line as well.

Maybe other more experienced Markdown users could help.

Regards,
-- 
Denis

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2015-09-16 18:03 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-09-12 14:57 Bug: Extra blank line in subitem list when exported to markdown [8.3.1 (8.3.1-103-g366dc4-elpa @ /home/bitouze/.emacs.d/elpa/org-20150907/)] Denis Bitouzé
2015-09-13 20:41 ` Nicolas Goaziou
     [not found]   ` <8737yiuk62.fsf-Gpy5sJQTEQHwkn9pgDnJRVAUjnlXr6A1@public.gmane.org>
2015-09-14  7:32     ` Denis Bitouzé
2015-09-16 12:51       ` Nicolas Goaziou
     [not found]         ` <87h9muwmr8.fsf-Gpy5sJQTEQHwkn9pgDnJRVAUjnlXr6A1@public.gmane.org>
2015-09-16 18:03           ` Denis Bitouzé

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).