diff --git a/README.md b/README.md index 8a1c702..ce43894 100644 --- a/README.md +++ b/README.md @@ -8,7 +8,7 @@ A language and parser written in Emacs Lisp for my custom extension of Markdown, - [x] Heading - [x] Bold - [x] Italic -- [ ] Blockquote +- [x] Blockquote (no nesting) - [x] Ordered List - [x] Unordered List - [x] Code diff --git a/blog/feed.xml b/blog/feed.xml index 042a1fc..701e152 100644 --- a/blog/feed.xml +++ b/blog/feed.xml @@ -1,4 +1,4 @@ -RSS Testhttp://example.comAn example blog for testing RSS capability of md4tj.en-USTue, 10 Jun 2003 04:00:00 GMTeditor@example.comwebmaster@example.comhttps://www.rssboard.org/rss-specificationmd4tj-rss.elSat, 30 Mar 2024 20:57:14 GMTBlog Post 2https://example.com/blog/blogpost2.htmlhttps://example.com/blog/blogpost2.html +RSS Testhttp://example.comAn example blog for testing RSS capability of md4tj.en-USTue, 10 Jun 2003 04:00:00 GMTeditor@example.comwebmaster@example.comhttps://www.rssboard.org/rss-specificationmd4tj-rss.elSat, 30 Mar 2024 21:40:13 GMTBlog Post 2https://example.com/blog/blogpost2.htmlhttps://example.com/blog/blogpost2.html <br> diff --git a/md4tj.el b/md4tj.el index 20307d2..3b0764b 100644 --- a/md4tj.el +++ b/md4tj.el @@ -19,10 +19,14 @@ (defun md4tj-util-clean-multiline (line) "Clean LINE of markdown syntax for ul's, ol's and code's." (replace-regexp-in-string - "^```" "" + "^```" "" ;; eliminate the 3 backticks for start of code (replace-regexp-in-string - "^[0-9]+\\. " "" - (replace-regexp-in-string "^- " "" line)))) + "^[0-9]+\\. " "" ;; eliminate the numbering for ordered lists + (replace-regexp-in-string + "^- " "" ;; eliminate the dashes for unordered lists + (replace-regexp-in-string + "^>" "" ;; eliminate the right-caret for quotes + line))))) (defun md4tj-util-escape-chars (line) "Escape characters in LINE that would be misinterpreted by the browser." @@ -164,6 +168,8 @@ ((eq state 'endcode) "\n\n") ((eq state 'begintable) "") ;; might need to add to this? ((eq state 'endtable) "
") + ((eq state 'beginquote) "
") + ((eq state 'endquote) "
") (t ""))) (defun md4tj-next-state (currline prevstate) @@ -176,6 +182,7 @@ ((and (not (string-match "[0-9]+\\. " currline)) (or (eq prevstate 'beginol) (eq prevstate 'ol))) 'endol) ((and (string-match "```$" currline) (or (eq prevstate 'code) (eq prevstate 'begincode))) 'endcode) ((and (not (string-match "^|.*|$" currline)) (or (eq prevstate 'begintable) (eq prevstate 'headtable) (eq prevstate 'table))) 'endtable) + ((and (not (string-match "^>.*" currline)) (or (eq prevstate 'beginquote) (eq prevstate 'quote))) 'endquote) (t 'nothing)) ;; Begin state (or next line's prevstate) @@ -187,6 +194,8 @@ ((and (not (string-match "```$" currline)) (or (eq prevstate 'begincode) (eq prevstate 'code)) 'code)) ((and (string-match "^|.*|$" currline) (not (or (eq prevstate 'table) (eq prevstate 'begintable)))) 'begintable) ((and (string-match "^|.*|$" currline) (or (eq prevstate 'begintable) (eq prevstate 'table))) 'table) + ((and (string-match "^>.*" currline) (not (or (eq prevstate 'quote) (eq prevstate 'beginquote)))) 'beginquote) + ((and (string-match "^>.*" currline) (or (eq prevstate 'beginquote) (eq prevstate 'quote))) 'quote) (t 'normal)))) (defun md4tj-begin () @@ -205,6 +214,7 @@ ((or (eq state 'beginol) (eq state 'ol)) "") ((or (eq state 'begincode) (eq state 'code)) "") ((or (eq state 'begintable) (eq state 'table)) "") + ((or (eq state 'beginquote) (eq state 'quote)) "") (t "")) "\n" "")) diff --git a/test_file.html b/test_file.html index 436c883..e5d8766 100644 --- a/test_file.html +++ b/test_file.html @@ -77,7 +77,7 @@ int main() {

This is a div that has monospace text.

-

Last updated: Sun 31 Mar 2024 00:57 UTC

+

Last updated: Sun 31 Mar 2024 01:40 UTC


@@ -127,5 +127,15 @@ int main() { - + +
+ +

Here is a quote:

+ +

You miss 100%

+ +

of the shots

+ +

you don't take

+
\ No newline at end of file diff --git a/test_file.md4tj b/test_file.md4tj index b623607..ef0feba 100644 --- a/test_file.md4tj +++ b/test_file.md4tj @@ -50,4 +50,9 @@ Content after the table - This is a div that - tests proper termination of list - within it -@@ENDDIV \ No newline at end of file +@@ENDDIV + +Here is a quote: +> You miss 100% +> of the shots +> you don't take \ No newline at end of file