ledge icon indicating copy to clipboard operation
ledge copied to clipboard

Single quote ESI tags aren't matched

Open jloh opened this issue 8 years ago • 2 comments

Unsure whether this is intended or not but ESI tags with single quotes wont match the below.

    local src, err = ngx_re_match(
        include_tag,
        [[src="([^"]+)"]],
        "oj"
    )

https://github.com/pintsized/ledge/blob/adf3372c5c6b6c4d659f13ba2fca40063a2176c9/lib/ledge/esi/processor_1_0.lua#L385-L404

jloh avatar Sep 21 '17 07:09 jloh

Yeah the ESI spec doesn't specify but it's XML-based and XML allows for single or double quotes. So I guess we should support both ideally.

hamishforbes avatar Sep 21 '17 09:09 hamishforbes

I think this is true for <esi:when test=""> tags as well.

Perhaps a good solution would be an attribute parsing utility function that can return you a table of attribute / value pairs. It should handle multiple attributes (something else we don't handle well at the moment) and this single/double quotes issue

hamishforbes avatar Sep 22 '17 09:09 hamishforbes