inukshuk / citeproc-ruby

A Citation Style Language (CSL) Cite Processor
101 stars 22 forks source link

fix: render the group when its content is a substituted names item #28

Closed rwos closed 9 years ago

rwos commented 9 years ago

The fix feels pretty hacky to me, but I don't know how to do that in a better way. But I guess the test is still valuable :) Feedback/comments much appreciated, obviously.

The issue is that groups containing substituted names items wouldn't render at all, even if there was actually something substituted for the missing variable.

inukshuk commented 9 years ago

That's a good one, thanks!

@rmzelle @fbennett @adam3smith this is the inteded behaviour, right?

When a Group calls a name variable that is not available, but renders a substitute, does the substitution string count as the variable's value when determining whether or not the group can be rendered?

adam3smith commented 9 years ago

yes.

inukshuk commented 9 years ago

@rwos I added a simulated_read_access method to the item; this way the notification internals are hidden, although you still need to know that they exist (added a comment for good measure as well). I still prefer using the observers on the citation data to having to establish a context for the substitution node during rendering (like, 'am I being rendered underneath a group node?' etc.).

rwos commented 9 years ago

@inukshuk nice, thanks!