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

Make XSL filter transform the item, not the layout - issue #399 #401

Merged
merged 1 commit into from Mar 15, 2014

Conversation

Projects
None yet
2 participants
@simonsouth
Contributor

simonsouth commented Mar 15, 2014

See issue #399, "XSL filter transforms the stylesheet's (layout's) content, not the item's".

Previously the XSL filter used the value of the "content" parameter passed to the "run" method as the content to transform. But when invoked as a layout, filters are passed the content of the layout in this parameter, not the content of the item. As this filter can only be invoked as a layout it did not work as expected.

This change modifies the filter to use the value of the ":content" parameter passed to the class at initialization as the content to transform, consistent with how layouts are invoked. It also updates the filter's test cases to reflect how the filter is actually used and to ensure the correct input is being transformed.

Make XSL filter transform the item, not the layout
Previously the XSL filter used the value of the "content" parameter
passed to the "run" method as the content to transform. But when
invoked as a layout, filters are passed the content of the _layout_
in this parameter, not the content of the item. As this filter can
only be invoked as a layout it did not work as expected.

This change modifies the filter to use the value of the ":content"
parameter passed to the class at initialization as the content to
transform, consistent with how layouts are invoked. It also updates
the filter's test cases to reflect how the filter is actually used
and to ensure the correct input is being transformed.
@ddfreyne

This comment has been minimized.

Show comment
Hide comment
@ddfreyne

ddfreyne Mar 15, 2014

Member

Cool stuff!

Member

ddfreyne commented Mar 15, 2014

Cool stuff!

ddfreyne added a commit that referenced this pull request Mar 15, 2014

Merge pull request #401 from simonsouth/bug/make-xsl-filter-process-i…
…tem-content

Make XSL filter transform the item, not the layout - issue #399

@ddfreyne ddfreyne merged commit 6e558dd into nanoc:release-3.6.x Mar 15, 2014

1 check passed

default The Travis CI build passed
Details

@ddfreyne ddfreyne added the bug/fix label Mar 15, 2014

@simonsouth simonsouth deleted the simonsouth:bug/make-xsl-filter-process-item-content branch Mar 15, 2014

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment