Skip to content

Errors when calling one print-data method from another. #17

@FrankRuben

Description

@FrankRuben

Hi Kanru,

first of all thanks for the library!

When I incorrectly created the mustache environment using something like '((key value)) instead of '((key . value)), I was hit by an error that the escape flag for {{{...}}} had not been correctly evaluated, means that even for the triple-pattern, escape was called.
It turned out that the incorrect environment did lead to the call of '(defmethod print-data (token escapep &optional context) ...)' and that this method forwarded processing to another print-data method with incorrect arguments: instead of calling '(print-data (princ-to-string token) (%output))' I think it's necessary to call '(print-data (princ-to-string token) escapep context)'. The incorrect call passed the stream %output as escape a non-nil flag, so that escape was always called, whereas the proposed fixed won't do this. (Also the context argument was missing.)

While searching, I also found that also '(defmethod print-data ((data symbol) escapep &optional context) ...)' does not pass the context parameter and I think it is necessary to change the body to '(print-data (string data) escapep context)'.

HTH and best regards, Frank

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions