Skip to content

Commit

Permalink
Fix the case where there is whitespace before the special > in verse
Browse files Browse the repository at this point in the history
Any whitespace before the special > char in verse block is now ignored
as expected.

Ref:
02f4372
  • Loading branch information
kaushalmodi committed Jul 15, 2019
1 parent be4d994 commit 578fa8d
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion ox-blackfriday.el
Expand Up @@ -1106,7 +1106,7 @@ contextual information."
;; Org removes all the leading whitespace only from the first
;; line. So the trick is to use the ">" character before any
;; intended indentation on the first non-blank line.
(ret (replace-regexp-in-string "\\`\\([[:blank:]\n\r]*\\)>" "\\1" ret))
(ret (replace-regexp-in-string "\\`\\([[:blank:]\n\r]*?\\)[[:blank:]]*>" "\\1" ret))
(br (org-html-close-tag "br" nil info))
(re (format "\\(?:%s\\)?[ \t]*\n" (regexp-quote br)))
;; Replace each newline character with line break. Also
Expand Down
16 changes: 8 additions & 8 deletions test/site/content-org/all-posts.org
Expand Up @@ -3617,23 +3617,23 @@ removed when translating to Markdown.
*** More examples
- More indentation than in the above example:
#+begin_verse
> Text indented by 8 spaces
#+end_verse
> Text indented by 8 spaces
#+end_verse
- Leading blank line followed by indented text:
#+begin_verse

> Text indented by 4 spaces
#+end_verse
> Text indented by 4 spaces
#+end_verse
- Indented text followed by a trailing blank line:
#+begin_verse
> Text indented by 4 spaces
> Text indented by 4 spaces

#+end_verse
#+end_verse
- Using tab characters for indentation; each tab character still
constitutes for one = = in HTML.
#+begin_verse
> Text indented by 4 tab characters
#+end_verse
> Text indented by 4 tab characters
#+end_verse
*** Corner cases
Only the *first* =>= character immediately following spaces and empty
lines will be removed:
Expand Down

0 comments on commit 578fa8d

Please sign in to comment.