Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
FrankRuben opened this issue Jul 20, 2014 · 1 comment
Open

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

FrankRuben opened this issue Jul 20, 2014 · 1 comment

Comments

@FrankRuben
Copy link

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

@kanru
Copy link
Owner

kanru commented Jul 22, 2014

Hi Frank,

Thanks for reporting! For the first issue could you provide a example? I'm considering to add APIs for building contexts in order to prevent such mistakes.

The second issue I think is fixed in 795ba18 so please check with latest release and see if it's fixed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants