dimagi/commcare-hq — pull request #3299 by dannyroberts (2014-04-30 13:01:38+00:00)
Title: interpolate output refs for readable form view

`get_question` now returns a value for labels that mocks a `unicode` but retains the information necessary to interpolate values into the blanks left by the `` nodes later if desired (see `ItextValue`).

The Readable Form Data feature then takes advantage of this and attempts to interpolate outputs with any available values. If the ref/value of the `` is a calculation rather than a simple ref, or if the ref is simply not found for some reason, it displays a blank with a little question mark.

The only other minor difference is that the previous solution stripped whitespace around strings, whereas this just preserves whatever whitespace was there, which I think is the correct behavior.