Compare commits

..

No commits in common. "60f9947916a7725507b4b094c880f5a8607e9249" and "9e3acb526f26a7f49613ca4f2420a871eaed44b8" have entirely different histories.

1 changed files with 8 additions and 4 deletions

View File

@ -70,9 +70,13 @@
"<" "&lt;"
(string-replace ">" "&gt;" line)))
(defun md4tj-convert-line-to-html (line state)
"Process LINE with STATE and return html."
(let ((cleanline (md4tj-clean-multiline line)))
;; Note: a "block" is the smallest unit of parsing
;; It is normally a line of the code, but can be
;; 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
;; Beginning of multiline block
(cond ((eq state 'beginul) "<ul>\n<li>")
@ -137,7 +141,7 @@
(setq line (with-current-buffer inbuf (getline)))
(setq state (md4tj-next-state line state))
;; Insert next line(s) into output file
(insert (concat (md4tj-convert-line-to-html line state) "\n"))
(insert (concat (md4tj-process-block line state) "\n"))
;; Advance input file by a line
(with-current-buffer inbuf (forward-line)))
(insert (md4tj-finalize state))