Gary,
When you have multiple instances of the same extension (with different arguments) on the same line, each instance repeats the first instance. If you trace the function call, each instance calls the function with the arguments of the first call.
If you put in a line break between the extension instances, markdown works correctly.
Below is some test code demonstrating the error
andy
(in-package :markdown)
(defextension (link-new :arguments ((text :required) (href :required)) :insertp t) (ecase phase (:parse ;; no worries ) (:render (format nil "<a href=~s target="_blank">~a</a>" href text))))
(defparameter *cliki* "Cliki link here: {link-new "cliki" "http://www.cliki.net%5C%22%7D.")
(defparameter *google* "Google link here: {link-new "google" "http://www.google.com%5C%22%7D.")
(defparameter *test-one-line* (concatenate 'string *cliki* " " *google*))
(defparameter *test-two-lines* (concatenate 'string *cliki* (string #\Newline) *google*))
(defun test-string (str) (let ((*render-active-functions* (append '(link-new) *render-active-functions*))) (nth-value 1 (markdown str :stream nil))))
MARKDOWN> (trace link-new) (LINK-NEW) MARKDOWN> (test-string *test-one-line*) 0: (LINK-NEW :RENDER ("cliki" "http://www.cliki.net") NIL) 0: LINK-NEW returned "<a href="http://www.cliki.net%5C" target="_blank">cliki</a>" 0: (LINK-NEW :RENDER ("cliki" "http://www.cliki.net") NIL) 0: LINK-NEW returned "<a href="http://www.cliki.net%5C" target="_blank">cliki</a>" "<p>Cliki link here: <a href="http://www.cliki.net%5C" target="_blank">cliki</a>. Google link here: <a href=" http://www.cliki.net%5C" target="_blank">cliki</a>. </p>" MARKDOWN> (test-string *test-two-lines*) 0: (LINK-NEW :RENDER ("cliki" "http://www.cliki.net") NIL) 0: LINK-NEW returned "<a href="http://www.cliki.net%5C" target="_blank">cliki</a>" 0: (LINK-NEW :RENDER ("google" "http://www.google.com") NIL) 0: LINK-NEW returned "<a href="http://www.google.com%5C" target="_blank">google</a>" "<p>Cliki link here: <a href="http://www.cliki.net%5C" target="_blank">cliki</a>. Google link here: <a href=" http://www.google.com%5C" target="_blank">google</a>. </p>" MARKDOWN>
Gary,
Sorry, this bug is fixed in the github version but not in the quicklisp version (darcs).
The bug was in utilities.lisp, function process-brackets with the variable buffer-count not being incremented
BTW: in order to load the github version I had to comment this line #-asdf-system-connections :container-dynamic-classes from cl-markdown.asd. I don't know where this system is defined.
andy
Hi Andy,
thanks for the update and for letting me know about the issue.
I'll let Zach know that QuickLisp should be using the github version.
regards,
On Dec 5, 2012, at 11:17 AM, Andy Peterson andy.arvid@gmail.com wrote:
Gary,
Sorry, this bug is fixed in the github version but not in the quicklisp version (darcs).
The bug was in utilities.lisp, function process-brackets with the variable buffer-count not being incremented
BTW: in order to load the github version I had to comment this line #-asdf-system-connections :container-dynamic-classes from cl-markdown.asd. I don't know where this system is defined.
andy _______________________________________________ cl-markdown-devel mailing list cl-markdown-devel@common-lisp.net http://lists.common-lisp.net/cgi-bin/mailman/listinfo/cl-markdown-devel
-- Gary Warren King, metabang.com Cell: (413) 559 8738 Fax: (206) 338-4052 gwkkwg on Skype * garethsan on AIM * gwking on twitter
cl-markdown-devel@common-lisp.net