@abaplint/runtime 2.7.138 → 2.7.139
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -6,6 +6,7 @@ const types_1 = require("../types");
|
|
|
6
6
|
function escape(input) {
|
|
7
7
|
let val = typeof input.val === "string" ? input.val : input.val.get();
|
|
8
8
|
const format = typeof input.format === "number" ? input.format : input.format.get();
|
|
9
|
+
// todo, optimize/cache regexes
|
|
9
10
|
switch (format) {
|
|
10
11
|
case 1: // e_xml_attr
|
|
11
12
|
val = val.replace(/&/g, "&");
|
|
@@ -9,6 +9,9 @@ function replace(input) {
|
|
|
9
9
|
if (typeof input.val === "string") {
|
|
10
10
|
val = input.val;
|
|
11
11
|
}
|
|
12
|
+
else if (input.val instanceof types_1.Character) {
|
|
13
|
+
val = input.val.getTrimEnd();
|
|
14
|
+
}
|
|
12
15
|
else {
|
|
13
16
|
val = input.val.get();
|
|
14
17
|
}
|
|
@@ -26,6 +29,9 @@ function replace(input) {
|
|
|
26
29
|
if (typeof input.sub === "string") {
|
|
27
30
|
sub = input.sub;
|
|
28
31
|
}
|
|
32
|
+
else if (input.sub instanceof types_1.Character) {
|
|
33
|
+
sub = input.sub.getTrimEnd();
|
|
34
|
+
}
|
|
29
35
|
else if (input.sub) {
|
|
30
36
|
sub = input.sub.get();
|
|
31
37
|
}
|