Compare commits
3 Commits
9e3acb526f
...
60f9947916
Author | SHA1 | Date |
---|---|---|
j4nk | 60f9947916 | |
j4nk | 421f8e8472 | |
j4nk | ad94c2f066 |
|
@ -70,13 +70,9 @@
|
||||||
"<" "<"
|
"<" "<"
|
||||||
(string-replace ">" ">" line)))
|
(string-replace ">" ">" line)))
|
||||||
|
|
||||||
|
(defun md4tj-convert-line-to-html (line state)
|
||||||
;; Note: a "block" is the smallest unit of parsing
|
"Process LINE with STATE and return html."
|
||||||
;; It is normally a line of the code, but can be
|
(let ((cleanline (md4tj-clean-multiline line)))
|
||||||
;; multiple lines in the case of a block (NI)
|
|
||||||
(defun md4tj-process-block (codeblock state)
|
|
||||||
"Process CODEBLOCK with STATE and return html."
|
|
||||||
(let ((cleanline (md4tj-clean-multiline codeblock)))
|
|
||||||
(concat
|
(concat
|
||||||
;; Beginning of multiline block
|
;; Beginning of multiline block
|
||||||
(cond ((eq state 'beginul) "<ul>\n<li>")
|
(cond ((eq state 'beginul) "<ul>\n<li>")
|
||||||
|
@ -141,7 +137,7 @@
|
||||||
(setq line (with-current-buffer inbuf (getline)))
|
(setq line (with-current-buffer inbuf (getline)))
|
||||||
(setq state (md4tj-next-state line state))
|
(setq state (md4tj-next-state line state))
|
||||||
;; Insert next line(s) into output file
|
;; Insert next line(s) into output file
|
||||||
(insert (concat (md4tj-process-block line state) "\n"))
|
(insert (concat (md4tj-convert-line-to-html line state) "\n"))
|
||||||
;; Advance input file by a line
|
;; Advance input file by a line
|
||||||
(with-current-buffer inbuf (forward-line)))
|
(with-current-buffer inbuf (forward-line)))
|
||||||
(insert (md4tj-finalize state))
|
(insert (md4tj-finalize state))
|
||||||
|
|
Loading…
Reference in New Issue