Merge "Simplify XML escaping"
diff --git a/lib/KorAP/XML/TEI.pm b/lib/KorAP/XML/TEI.pm
index 27ef6f9..de68534 100644
--- a/lib/KorAP/XML/TEI.pm
+++ b/lib/KorAP/XML/TEI.pm
@@ -73,17 +73,13 @@
# Escape strings using XML entities
sub escape_xml {
- my $data = shift // '';
- $data =~ s/([&<>"])/$ent{$1}/ge;
- return $data;
+ ($_[0] // '') =~ s/([&<>"])/$ent{$1}/ger;
};
# Escape
sub escape_xml_minimal {
- my $data = shift // '';
- $data =~ s/([&<>])/$ent_without_quot{$1}/ge;
- return $data;
+ ($_[0] // '') =~ s/([&<>])/$ent_without_quot{$1}/ger;
};