<commit_before><?php

class Pagemill_Tag_Choose extends Pagemill_Tag {
	public function output(Pagemill_Data $data, Pagemill_Stream $stream) {
		foreach ($this->children() as $child) {
			if (is_a($child, 'Pagemill_tag')) {
				if ($child->name == 'pm:when') {
					$expr = $child->getAttribute('expr');
					if (strpos($expr, '@{') === false) {
						$expr = "@{" . $expr . "}@";
					}
					$value = $data->parseVariables($expr);
					if ($value) {
						$child->process($data, $stream);
						return;
					}
				} else if ($child->name == 'pm:otherwise') {
					$child->process($data, $stream);
					return;
				}
			}
		}
	}
}
<commit_msg>Process only inner content of pm:when and pm:otherwise elements.<commit_after><?php

class Pagemill_Tag_Choose extends Pagemill_Tag {
	public function output(Pagemill_Data $data, Pagemill_Stream $stream) {
		foreach ($this->children() as $child) {
			if (is_a($child, 'Pagemill_tag')) {
				if ($child->name == 'pm:when') {
					$expr = $child->getAttribute('expr');
					if (strpos($expr, '@{') === false) {
						$expr = "@{" . $expr . "}@";
					}
					$value = $data->parseVariables($expr);
					if ($value) {
						$child->processInner($data, $stream);
						return;
					}
				} else if ($child->name == 'pm:otherwise') {
					$child->processInner($data, $stream);
					return;
				}
			}
		}
	}
}

{'fraction_non_alphanumeric': 0.18996415770609318, 'fraction_numerical': 0.0, 'mean_word_length': 2.6736842105263157, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 17, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6516192', 'n_tokens_mistral': 600, 'n_tokens_neox': 473, 'n_words': 92}