From f81885106c35dad1b16322482e0a187107dc82e0 Mon Sep 17 00:00:00 2001 From: j4nk Date: Tue, 3 Jan 2023 18:34:40 -0500 Subject: [PATCH] Added video capability with !! --- Makefile | 2 ++ md4tj_parse.el | 6 +++++- test_file.html | 3 +-- test_file.md4tj | 2 +- 4 files changed, 9 insertions(+), 4 deletions(-) create mode 100644 Makefile diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..f42f950 --- /dev/null +++ b/Makefile @@ -0,0 +1,2 @@ +all: + emacs --no-site-file --batch -l ./md4tj_parse.el --eval "(md4tj-parse \"test_file.md4tj\" \"test_file.html\")" diff --git a/md4tj_parse.el b/md4tj_parse.el index 14d9836..8f28f8f 100644 --- a/md4tj_parse.el +++ b/md4tj_parse.el @@ -43,6 +43,10 @@ (replace-regexp-in-string "!\\[\\([^\\[]*\\)](\\([^\\[]*\\))" (md4tj-begin-tag "img" (list '("src" "\\2") '("alt" "\\1"))) + ;; Then videos + (replace-regexp-in-string + "!!\\[\\([^\\[]*\\)](\\([^\\[]*\\))" + (concat (md4tj-begin-tag "video" (list '("src" "\\2") '("type" "video/webm"))) "\\1" (md4tj-end-tag "video")) ;; Then emphasis (replace-regexp-in-string "\\*\\(.*\\)\\*" @@ -54,7 +58,7 @@ ;; First code (replace-regexp-in-string "`\\(.*\\)`" - "\\1" line)))))) + "\\1" line))))))) (defun md4tj-clean-multiline (line) "Clean LINE of markdown syntax for ul." diff --git a/test_file.html b/test_file.html index 4ca3b9e..ab5568c 100644 --- a/test_file.html +++ b/test_file.html @@ -2,7 +2,6 @@ - Test webpage @@ -11,7 +10,6 @@ -

Hello world!

Hello world!

Hello world!

@@ -22,6 +20,7 @@

Example website

Example image

+