[cl-markdown-devel] case sensitivity/preservation question

Daniel Herring dherring at tentpost.com
Thu Nov 6 20:54:29 UTC 2008


On Wed, 5 Nov 2008, Daniel Herring wrote:
> On Tue, 4 Nov 2008, Gary King wrote:
>> On Nov 4, 2008, at 12:50 AM, Daniel Herring wrote:
>>> cl-user> (require :cl-markdown)
>>> cl-user> (cl-markdown:markdown #P"index.md")
>>>
>>> This mostly works, but it complains that
>>> Unable to find RESOURCES/HEADER.MD in any of the search-locations
>>> Unable to find RESOURCES/FOOTER.MD in any of the search-locations
>>
>> thanks for the report; I'm traveling right now but will try to look at this
>> soon.
>
> Ok.  I hoped this was simply a case of user error.
>
> After poking around, I think the problem is the read-from-string in
> %pull-arguments-from-string.
>
> (cl-markdown::%pull-arguments-from-string "resources/header.md")
> -> (RESOURCES/HEADER.MD)

Here's a rough "works for me for today" fix.

(defmethod process-span ((name (eql 'eval)) registers)
   ;; the one register contains the command and the buffer index.
   (bind (((command &rest args)
 	  (%pull-arguments-from-string (first registers)))
 	 (buffer-index (and args (fixnump (first args)) (first args))))
     (process-handle-eval
      command
      (or (and buffer-index
               ;; dherring added the following IF
               (if (eql command 'cl-user::include)
                   (list (item-at (bracket-references *current-document*)
                                  buffer-index))
                   (%pull-arguments-from-string
                    (item-at (bracket-references *current-document*)
                             buffer-index))))
 	 args))))


But having gotten that far, I think it would be better to simply use
{include "file.md"}
instead of
{include file.md}


- Daniel




More information about the Cl-markdown-devel mailing list