Skip to content

Commit

Permalink
Fix regexes for blockquote tag and horizontal ruler.
Browse files Browse the repository at this point in the history
  • Loading branch information
mnuessler committed Oct 1, 2012
1 parent 74ed2b0 commit e3c1e84
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
14 changes: 7 additions & 7 deletions jira-markup-mode-test.el
Expand Up @@ -5,24 +5,24 @@
(should (string-match-p jira-markup-regex-header-1 "h1. "))
(should (string-match-p jira-markup-regex-header-1 "h1. Header"))
;; (should (string-match-p jira-markup-regex-header-1 " h1. Header "))
(should (not (string-match-p jira-markup-regex-header-1 "a h1. Header")))
(should (not (string-match-p jira-markup-regex-header-1 " a h1. Header"))))
(should-not (string-match-p jira-markup-regex-header-1 "a h1. Header"))
(should-not (string-match-p jira-markup-regex-header-1 " a h1. Header")))

(ert-deftest jira-markup-regex-header-2-test ()
(should (string-match-p jira-markup-regex-header-2 "h2. "))
(should (string-match-p jira-markup-regex-header-2 "h2. Header"))
(should (not (string-match-p jira-markup-regex-header-2 "a h2. Header")))
(should (not (string-match-p jira-markup-regex-header-2 " a h2. Header"))))
(should-not (string-match-p jira-markup-regex-header-2 "a h2. Header"))
(should-not (string-match-p jira-markup-regex-header-2 " a h2. Header")))

(ert-deftest jira-markup-regex-blockquote-test ()
(should (string-match-p jira-markup-regex-blockquote "bq. "))
(should (string-match-p jira-markup-regex-blockquote " bq. "))
(should (string-match-p jira-markup-regex-blockquote "bq. the-quote"))
;; (should (string-match-p jira-markup-regex-blockquote " bq. the-quote "))
(should (not (string-match-p jira-markup-regex-blockquote "a bq. the-quote"))))
(should-not (string-match-p jira-markup-regex-blockquote "a bq. the-quote")))

(ert-deftest jira-markup-regex-hr-test ()
(should (string-match-p jira-markup-regex-hr "----"))
(should (string-match-p jira-markup-regex-hr " ----"))
(should (not (string-match-p jira-markup-regex-hr "---")))
(should (not (string-match-p jira-markup-regex-hr "-----"))))
(should-not (string-match-p jira-markup-regex-hr "---"))
(should-not (string-match-p jira-markup-regex-hr "-----")))
4 changes: 2 additions & 2 deletions jira-markup-mode.el
Expand Up @@ -323,7 +323,7 @@ Otherwise, they will be treated as [[PageName|alias text]]."
"Regular expression for level 6 headers.")

(defconst jira-markup-regex-hr
"^\\(\\*[ ]?\\*[ ]?\\*[ ]?[\\* ]*\\|-[ ]?-[ ]?-[---- ]*\\)$"
"^[ \t]*----$"
"Regular expression for matching Jira-Markup horizontal rules.")

(defconst jira-markup-regex-code
Expand All @@ -347,7 +347,7 @@ Otherwise, they will be treated as [[PageName|alias text]]."
"Regular expression for matching italic text.")

(defconst jira-markup-regex-blockquote
"^bq\\. \\(.*\n\\)+\n"
"^[ \t]*bq\\."
"Regular expression for matching blockquote lines.")

(defconst jira-markup-regex-line-break
Expand Down

0 comments on commit e3c1e84

Please sign in to comment.