+
+# apply html escaping on the original content
+# we'll display the value without escaping later (for MakeClicky et al.)
+$content = $m->interp->apply_escapes($content, 'h');
+
+my @lines = split /\n/, $content;
+my $in_header = 0;
+my @headers;
+
+for (@lines) {
+ if (/^(\S+):\s+(.*)$/) {
+ push @headers, { Tag => $1, Value => $2 };
+ }
+ elsif (/^\s+/) {
+ $headers[-1]->{'Value'} .= $_;
+ }
+ else {
+ s/:$//;
+ push @headers, { Tag => $_, Value => '' };
+ }
+}
+
+my %display_headers = map { lc($_) => 1 } @$DisplayHeaders;
+
+$m->comp('/Elements/Callback', _CallbackName => 'Headers', content => \$content, headers => \@headers, display_headers => \%display_headers, %ARGS);
+