@ihk-gfi/lux-components-update 11.13.0 → 13.0.1

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.
Files changed (230) hide show
  1. package/README.md +2 -4
  2. package/package.json +14 -17
  3. package/src/add-lux-components/files/app/app.component.html +1 -1
  4. package/src/add-lux-components/files/app/app.component.ts +4 -1
  5. package/src/add-lux-components/files/locale/messages.en.xlf +489 -235
  6. package/src/add-lux-components/files/locale/messages.xlf +451 -218
  7. package/src/add-lux-components/files/scripts/.browserslistrc +10 -7
  8. package/src/add-lux-components/files/src/index.html +31 -0
  9. package/src/add-lux-components/index.js +151 -78
  10. package/src/add-lux-components/index.js.map +1 -1
  11. package/src/add-lux-components/index.ts +141 -66
  12. package/src/add-lux-components/index_spec.js +4 -4
  13. package/src/add-lux-components/index_spec.js.map +1 -1
  14. package/src/add-lux-components/index_spec.ts +1 -1
  15. package/src/add-lux-components/schema.json +1 -1
  16. package/src/collection.json +8 -88
  17. package/src/update-dependencies/index.d.ts +1 -1
  18. package/src/update-dependencies/index.js +82 -65
  19. package/src/update-dependencies/index.js.map +1 -1
  20. package/src/update-dependencies/index.ts +112 -95
  21. package/src/update-dependencies/schema.json +1 -1
  22. package/src/update-en-messages/index.d.ts +2 -0
  23. package/src/update-en-messages/index.js +75 -0
  24. package/src/update-en-messages/index.js.map +1 -0
  25. package/src/update-en-messages/index.ts +78 -0
  26. package/src/{update110100 → update-en-messages}/schema.json +3 -3
  27. package/src/updates/update130000/files/root/.browserslistrc +20 -0
  28. package/src/updates/update130000/index.d.ts +27 -0
  29. package/src/updates/update130000/index.js +296 -0
  30. package/src/updates/update130000/index.js.map +1 -0
  31. package/src/updates/update130000/index.ts +346 -0
  32. package/src/{migrate-to-eslint → updates/update130000}/index_spec.d.ts +0 -0
  33. package/src/updates/update130000/index_spec.js +574 -0
  34. package/src/updates/update130000/index_spec.js.map +1 -0
  35. package/src/updates/update130000/index_spec.ts +665 -0
  36. package/src/{update → updates/update130000}/schema.json +1 -1
  37. package/src/utility/dependencies.js +16 -14
  38. package/src/utility/dependencies.js.map +1 -1
  39. package/src/utility/dependencies.ts +6 -4
  40. package/src/utility/files.d.ts +5 -1
  41. package/src/utility/files.js +27 -16
  42. package/src/utility/files.js.map +1 -1
  43. package/src/utility/files.ts +16 -3
  44. package/src/utility/html.js +88 -25
  45. package/src/utility/html.js.map +1 -1
  46. package/src/utility/html.ts +105 -29
  47. package/src/{migrate-to-webcomponent/index_spec.d.ts → utility/html_spec.d.ts} +0 -0
  48. package/src/utility/html_spec.js +560 -0
  49. package/src/utility/html_spec.js.map +1 -0
  50. package/src/utility/html_spec.ts +575 -0
  51. package/src/utility/json.d.ts +46 -1
  52. package/src/utility/json.js +174 -4
  53. package/src/utility/json.js.map +1 -1
  54. package/src/utility/json.ts +198 -3
  55. package/src/{update/index_spec.d.ts → utility/json_spec.d.ts} +0 -0
  56. package/src/utility/json_spec.js +326 -0
  57. package/src/utility/json_spec.js.map +1 -0
  58. package/src/utility/json_spec.ts +376 -0
  59. package/src/utility/typescript.js +16 -16
  60. package/src/utility/typescript.js.map +1 -1
  61. package/src/utility/typescript_spec.js +36 -36
  62. package/src/utility/typescript_spec.js.map +1 -1
  63. package/src/utility/util.d.ts +2 -2
  64. package/src/utility/util.js +16 -14
  65. package/src/utility/util.js.map +1 -1
  66. package/src/utility/util.ts +7 -5
  67. package/src/utility/validation.js +11 -11
  68. package/src/utility/validation.js.map +1 -1
  69. package/src/migrate-to-eslint/files/.eslintrc.json +0 -68
  70. package/src/migrate-to-eslint/files/.prettierrc +0 -25
  71. package/src/migrate-to-eslint/index.d.ts +0 -6
  72. package/src/migrate-to-eslint/index.js +0 -149
  73. package/src/migrate-to-eslint/index.js.map +0 -1
  74. package/src/migrate-to-eslint/index.ts +0 -181
  75. package/src/migrate-to-eslint/index_spec.js +0 -129
  76. package/src/migrate-to-eslint/index_spec.js.map +0 -1
  77. package/src/migrate-to-eslint/index_spec.ts +0 -152
  78. package/src/migrate-to-eslint/schema.json +0 -23
  79. package/src/migrate-to-webcomponent/index.d.ts +0 -10
  80. package/src/migrate-to-webcomponent/index.js +0 -278
  81. package/src/migrate-to-webcomponent/index.js.map +0 -1
  82. package/src/migrate-to-webcomponent/index.ts +0 -331
  83. package/src/migrate-to-webcomponent/index_spec.js +0 -580
  84. package/src/migrate-to-webcomponent/index_spec.js.map +0 -1
  85. package/src/migrate-to-webcomponent/index_spec.ts +0 -703
  86. package/src/migrate-to-webcomponent/schema.json +0 -23
  87. package/src/update/files/locale/messages.en.xlf +0 -940
  88. package/src/update/files/locale/messages.xlf +0 -815
  89. package/src/update/files/scripts/move-de-files.js +0 -15
  90. package/src/update/index.d.ts +0 -23
  91. package/src/update/index.js +0 -635
  92. package/src/update/index.js.map +0 -1
  93. package/src/update/index.ts +0 -712
  94. package/src/update/index_spec.js +0 -984
  95. package/src/update/index_spec.js.map +0 -1
  96. package/src/update/index_spec.ts +0 -1139
  97. package/src/update110001/index.d.ts +0 -2
  98. package/src/update110001/index.js +0 -42
  99. package/src/update110001/index.js.map +0 -1
  100. package/src/update110001/index.ts +0 -40
  101. package/src/update110001/index_spec.d.ts +0 -1
  102. package/src/update110001/index_spec.js +0 -67
  103. package/src/update110001/index_spec.js.map +0 -1
  104. package/src/update110001/index_spec.ts +0 -72
  105. package/src/update110001/schema.json +0 -23
  106. package/src/update110100/index.d.ts +0 -2
  107. package/src/update110100/index.js +0 -27
  108. package/src/update110100/index.js.map +0 -1
  109. package/src/update110100/index.ts +0 -24
  110. package/src/update110100/index_spec.d.ts +0 -1
  111. package/src/update110100/index_spec.js +0 -69
  112. package/src/update110100/index_spec.js.map +0 -1
  113. package/src/update110100/index_spec.ts +0 -73
  114. package/src/update110101/index.d.ts +0 -2
  115. package/src/update110101/index.js +0 -24
  116. package/src/update110101/index.js.map +0 -1
  117. package/src/update110101/index.ts +0 -21
  118. package/src/update110101/index_spec.d.ts +0 -1
  119. package/src/update110101/index_spec.js +0 -65
  120. package/src/update110101/index_spec.js.map +0 -1
  121. package/src/update110101/index_spec.ts +0 -69
  122. package/src/update110101/schema.json +0 -23
  123. package/src/update110200/index.d.ts +0 -2
  124. package/src/update110200/index.js +0 -24
  125. package/src/update110200/index.js.map +0 -1
  126. package/src/update110200/index.ts +0 -21
  127. package/src/update110200/index_spec.d.ts +0 -1
  128. package/src/update110200/index_spec.js +0 -65
  129. package/src/update110200/index_spec.js.map +0 -1
  130. package/src/update110200/index_spec.ts +0 -69
  131. package/src/update110200/schema.json +0 -23
  132. package/src/update110300/index.d.ts +0 -2
  133. package/src/update110300/index.js +0 -133
  134. package/src/update110300/index.js.map +0 -1
  135. package/src/update110300/index.ts +0 -148
  136. package/src/update110300/index_spec.d.ts +0 -1
  137. package/src/update110300/index_spec.js +0 -121
  138. package/src/update110300/index_spec.js.map +0 -1
  139. package/src/update110300/index_spec.ts +0 -139
  140. package/src/update110300/schema.json +0 -23
  141. package/src/update110400/index.d.ts +0 -2
  142. package/src/update110400/index.js +0 -28
  143. package/src/update110400/index.js.map +0 -1
  144. package/src/update110400/index.ts +0 -28
  145. package/src/update110400/index_spec.d.ts +0 -1
  146. package/src/update110400/index_spec.js +0 -66
  147. package/src/update110400/index_spec.js.map +0 -1
  148. package/src/update110400/index_spec.ts +0 -70
  149. package/src/update110400/schema.json +0 -23
  150. package/src/update110500/index.d.ts +0 -2
  151. package/src/update110500/index.js +0 -28
  152. package/src/update110500/index.js.map +0 -1
  153. package/src/update110500/index.ts +0 -28
  154. package/src/update110500/index_spec.d.ts +0 -1
  155. package/src/update110500/index_spec.js +0 -66
  156. package/src/update110500/index_spec.js.map +0 -1
  157. package/src/update110500/index_spec.ts +0 -70
  158. package/src/update110500/schema.json +0 -23
  159. package/src/update110600/index.d.ts +0 -2
  160. package/src/update110600/index.js +0 -28
  161. package/src/update110600/index.js.map +0 -1
  162. package/src/update110600/index.ts +0 -28
  163. package/src/update110600/index_spec.d.ts +0 -1
  164. package/src/update110600/index_spec.js +0 -66
  165. package/src/update110600/index_spec.js.map +0 -1
  166. package/src/update110600/index_spec.ts +0 -70
  167. package/src/update110600/schema.json +0 -23
  168. package/src/update110700/index.d.ts +0 -2
  169. package/src/update110700/index.js +0 -45
  170. package/src/update110700/index.js.map +0 -1
  171. package/src/update110700/index.ts +0 -47
  172. package/src/update110700/index_spec.d.ts +0 -1
  173. package/src/update110700/index_spec.js +0 -108
  174. package/src/update110700/index_spec.js.map +0 -1
  175. package/src/update110700/index_spec.ts +0 -122
  176. package/src/update110700/schema.json +0 -23
  177. package/src/update110800/index.d.ts +0 -2
  178. package/src/update110800/index.js +0 -32
  179. package/src/update110800/index.js.map +0 -1
  180. package/src/update110800/index.ts +0 -33
  181. package/src/update110800/index_spec.d.ts +0 -1
  182. package/src/update110800/index_spec.js +0 -70
  183. package/src/update110800/index_spec.js.map +0 -1
  184. package/src/update110800/index_spec.ts +0 -75
  185. package/src/update110800/schema.json +0 -23
  186. package/src/update110900/index.d.ts +0 -4
  187. package/src/update110900/index.js +0 -111
  188. package/src/update110900/index.js.map +0 -1
  189. package/src/update110900/index.ts +0 -123
  190. package/src/update110900/index_spec.d.ts +0 -1
  191. package/src/update110900/index_spec.js +0 -311
  192. package/src/update110900/index_spec.js.map +0 -1
  193. package/src/update110900/index_spec.ts +0 -341
  194. package/src/update110900/schema.json +0 -23
  195. package/src/update111000/index.d.ts +0 -2
  196. package/src/update111000/index.js +0 -27
  197. package/src/update111000/index.js.map +0 -1
  198. package/src/update111000/index.ts +0 -27
  199. package/src/update111000/index_spec.d.ts +0 -1
  200. package/src/update111000/index_spec.js +0 -65
  201. package/src/update111000/index_spec.js.map +0 -1
  202. package/src/update111000/index_spec.ts +0 -70
  203. package/src/update111000/schema.json +0 -23
  204. package/src/update111100/index.d.ts +0 -2
  205. package/src/update111100/index.js +0 -389
  206. package/src/update111100/index.js.map +0 -1
  207. package/src/update111100/index.ts +0 -405
  208. package/src/update111100/index_spec.d.ts +0 -1
  209. package/src/update111100/index_spec.js +0 -66
  210. package/src/update111100/index_spec.js.map +0 -1
  211. package/src/update111100/index_spec.ts +0 -70
  212. package/src/update111100/schema.json +0 -23
  213. package/src/update111200/index.d.ts +0 -2
  214. package/src/update111200/index.js +0 -59
  215. package/src/update111200/index.js.map +0 -1
  216. package/src/update111200/index.ts +0 -75
  217. package/src/update111200/index_spec.d.ts +0 -1
  218. package/src/update111200/index_spec.js +0 -67
  219. package/src/update111200/index_spec.js.map +0 -1
  220. package/src/update111200/index_spec.ts +0 -71
  221. package/src/update111200/schema.json +0 -23
  222. package/src/update111300/index.d.ts +0 -2
  223. package/src/update111300/index.js +0 -27
  224. package/src/update111300/index.js.map +0 -1
  225. package/src/update111300/index.ts +0 -27
  226. package/src/update111300/index_spec.d.ts +0 -1
  227. package/src/update111300/index_spec.js +0 -65
  228. package/src/update111300/index_spec.js.map +0 -1
  229. package/src/update111300/index_spec.ts +0 -69
  230. package/src/update111300/schema.json +0 -23
@@ -1,6 +1,8 @@
1
- const cheerio = require('cheerio');
1
+ import { replaceAll } from './util';
2
2
 
3
- const luxCherioParserOptions = { xmlMode: true, decodeEntities: false, selfClosingTags: false };
3
+ const cheerio = require('cheerio');
4
+ const luxCheerioParserOptions = { xmlMode: true, decodeEntities: false, selfClosingTags: false };
5
+ const emptyPlaceholderToken = '@20c44b9d-45e1-447a-a141-1de0695c9c35@';
4
6
 
5
7
  export class CheerioInfo {
6
8
  content: string;
@@ -21,17 +23,18 @@ export class CheerioInfo {
21
23
  * @param attrValue
22
24
  */
23
25
  export function addAttribute(content: string, selector: string, attrName: string, attrValue: string): CheerioInfo {
24
- const $ = cheerio.load(content, luxCherioParserOptions);
25
-
26
- const result = new CheerioInfo(content);
26
+ let newContent = preProcessing(content);
27
+ const $ = cheerio.load(newContent, luxCheerioParserOptions);
28
+ const result = new CheerioInfo(newContent);
27
29
 
28
30
  $(selector).each(function (i, elem) {
29
- $(elem).attr(attrName, attrValue);
31
+ $(elem).attr(attrName, attrValue ? attrValue : emptyPlaceholderToken);
30
32
  result.updated = true;
31
33
  });
32
34
 
33
35
  if (result.updated) {
34
36
  result.content = $.xml();
37
+ result.content = postProcessing(result.content);
35
38
  }
36
39
 
37
40
  return result;
@@ -46,17 +49,39 @@ export function addAttribute(content: string, selector: string, attrName: string
46
49
  * @param attrValue
47
50
  */
48
51
  export function appendAttribute(content: string, selector: string, attrName: string, attrValue: string): CheerioInfo {
49
- const $ = cheerio.load(content, luxCherioParserOptions);
50
-
51
- const result = new CheerioInfo(content);
52
+ let newContent = preProcessing(content);
53
+ const $ = cheerio.load(newContent, luxCheerioParserOptions);
54
+ const result = new CheerioInfo(newContent);
52
55
 
53
56
  $(selector).each(function (i, elem) {
54
- $(elem).attr(attrName, $(elem).attr(attrName) + attrValue);
55
- result.updated = true;
57
+ const attrNameNoBinding = attrName;
58
+ if ($(elem).attr(attrNameNoBinding)) {
59
+ $(elem).attr(attrNameNoBinding, $(elem).attr(attrNameNoBinding) + attrValue);
60
+ result.updated = true;
61
+ }
62
+
63
+ const attrNameDataBinding = '[' + attrName + ']';
64
+ if ($(elem).attr(attrNameDataBinding)) {
65
+ $(elem).attr(attrNameDataBinding, $(elem).attr(attrNameDataBinding) + attrValue);
66
+ result.updated = true;
67
+ }
68
+
69
+ const attrNameTwoWayBinding = '[(' + attrName + ')]';
70
+ if ($(elem).attr(attrNameTwoWayBinding)) {
71
+ $(elem).attr(attrNameTwoWayBinding, $(elem).attr(attrNameTwoWayBinding) + attrValue);
72
+ result.updated = true;
73
+ }
74
+
75
+ const attrNameEventBinding = '(' + attrName + ')';
76
+ if ($(elem).attr(attrNameEventBinding)) {
77
+ $(elem).attr(attrNameEventBinding, $(elem).attr(attrNameEventBinding) + attrValue);
78
+ result.updated = true;
79
+ }
56
80
  });
57
81
 
58
82
  if (result.updated) {
59
83
  result.content = $.xml();
84
+ result.content = postProcessing(result.content);
60
85
  }
61
86
 
62
87
  return result;
@@ -70,10 +95,16 @@ export function appendAttribute(content: string, selector: string, attrName: str
70
95
  * @param attrNameOld Ein beliebiger Attributname (z.B. luxItem).
71
96
  * @param attrNameNew Ein beliebiger neuer Attributname.
72
97
  */
73
- export function renameAttribute( content: string, selector: string, attrNameOld: string, attrNameNew: string): CheerioInfo {
74
- const $ = cheerio.load(content, luxCherioParserOptions);
98
+ export function renameAttribute(
99
+ content: string,
100
+ selector: string,
101
+ attrNameOld: string,
102
+ attrNameNew: string
103
+ ): CheerioInfo {
104
+ let newContent = preProcessing(content);
105
+ const $ = cheerio.load(newContent, luxCheerioParserOptions);
75
106
 
76
- const result = new CheerioInfo(content);
107
+ const result = new CheerioInfo(newContent);
77
108
 
78
109
  $(selector).each(function (i, elem) {
79
110
  const attrNameNoBindingOld = attrNameOld;
@@ -81,7 +112,7 @@ export function renameAttribute( content: string, selector: string, attrNameO
81
112
  const attrValueNoBinding = $(elem).attr(attrNameNoBindingOld);
82
113
  if (attrValueNoBinding) {
83
114
  $(elem).removeAttr(attrNameNoBindingOld);
84
- $(elem).attr(attrNameNoBindingNew, attrValueNoBinding);
115
+ $(elem).attr(attrNameNoBindingNew, attrValueNoBinding ? attrValueNoBinding : emptyPlaceholderToken);
85
116
  result.updated = true;
86
117
  }
87
118
 
@@ -90,7 +121,7 @@ export function renameAttribute( content: string, selector: string, attrNameO
90
121
  const attrNameDataBindingValue = $(elem).attr(attrNameDataBindingOld);
91
122
  if (attrNameDataBindingValue) {
92
123
  $(elem).removeAttr(attrNameDataBindingOld);
93
- $(elem).attr(attrNameDataBindingNew, attrNameDataBindingValue);
124
+ $(elem).attr(attrNameDataBindingNew, attrNameDataBindingValue ? attrNameDataBindingValue : emptyPlaceholderToken);
94
125
  result.updated = true;
95
126
  }
96
127
 
@@ -99,7 +130,7 @@ export function renameAttribute( content: string, selector: string, attrNameO
99
130
  const attrValueTwoWayBinding = $(elem).attr(attrNameTwoWayBindingOld);
100
131
  if (attrValueTwoWayBinding) {
101
132
  $(elem).removeAttr(attrNameTwoWayBindingOld);
102
- $(elem).attr(attrNameTwoWayBindingNew, attrValueTwoWayBinding);
133
+ $(elem).attr(attrNameTwoWayBindingNew, attrValueTwoWayBinding ? attrValueTwoWayBinding : emptyPlaceholderToken);
103
134
  result.updated = true;
104
135
  }
105
136
 
@@ -108,13 +139,14 @@ export function renameAttribute( content: string, selector: string, attrNameO
108
139
  const attrValueEventBinding = $(elem).attr(attrNameEventBindingOld);
109
140
  if (attrValueEventBinding) {
110
141
  $(elem).removeAttr(attrNameEventBindingOld);
111
- $(elem).attr(attrNameEventBindingNew, attrValueEventBinding);
142
+ $(elem).attr(attrNameEventBindingNew, attrValueEventBinding ? attrValueEventBinding : emptyPlaceholderToken);
112
143
  result.updated = true;
113
144
  }
114
145
  });
115
146
 
116
147
  if (result.updated) {
117
148
  result.content = $.xml();
149
+ result.content = postProcessing(result.content);
118
150
  }
119
151
 
120
152
  return result;
@@ -129,38 +161,40 @@ export function renameAttribute( content: string, selector: string, attrNameO
129
161
  * @param attrValue Ein beliebiger Wert.
130
162
  */
131
163
  export function updateAttribute(content: string, selector: string, attrName: string, attrValue: string): CheerioInfo {
132
- const $ = cheerio.load(content, luxCherioParserOptions);
164
+ let newContent = preProcessing(content);
165
+ const $ = cheerio.load(newContent, luxCheerioParserOptions);
133
166
 
134
- const result = new CheerioInfo(content);
167
+ const result = new CheerioInfo(newContent);
135
168
 
136
169
  $(selector).each(function (i, elem) {
137
170
  const attrNameNoBinding = attrName;
138
171
  if ($(elem).attr(attrNameNoBinding)) {
139
- $(elem).attr(attrNameNoBinding, attrValue);
172
+ $(elem).attr(attrNameNoBinding, attrValue ? attrValue : emptyPlaceholderToken);
140
173
  result.updated = true;
141
174
  }
142
175
 
143
176
  const attrNameDataBinding = '[' + attrName + ']';
144
177
  if ($(elem).attr(attrNameDataBinding)) {
145
- $(elem).attr(attrNameDataBinding, attrValue);
178
+ $(elem).attr(attrNameDataBinding, attrValue ? attrValue : emptyPlaceholderToken);
146
179
  result.updated = true;
147
180
  }
148
181
 
149
182
  const attrNameTwoWayBinding = '[(' + attrName + ')]';
150
183
  if ($(elem).attr(attrNameTwoWayBinding)) {
151
- $(elem).attr(attrNameTwoWayBinding, attrValue);
184
+ $(elem).attr(attrNameTwoWayBinding, attrValue ? attrValue : emptyPlaceholderToken);
152
185
  result.updated = true;
153
186
  }
154
187
 
155
188
  const attrNameEventBinding = '(' + attrName + ')';
156
189
  if ($(elem).attr(attrNameEventBinding)) {
157
- $(elem).attr(attrNameEventBinding, attrValue);
190
+ $(elem).attr(attrNameEventBinding, attrValue ? attrValue : emptyPlaceholderToken);
158
191
  result.updated = true;
159
192
  }
160
193
  });
161
194
 
162
195
  if (result.updated) {
163
196
  result.content = $.xml();
197
+ result.content = postProcessing(result.content);
164
198
  }
165
199
 
166
200
  return result;
@@ -174,39 +208,81 @@ export function updateAttribute(content: string, selector: string, attrName: str
174
208
  * @param attrName Ein beliebiger Attributname (z.B. luxListItem).
175
209
  */
176
210
  export function removeAttribute(content: string, selector: string, attrName: string): CheerioInfo {
177
- const $ = cheerio.load(content, luxCherioParserOptions);
211
+ let newContent = preProcessing(content);
212
+ const $ = cheerio.load(newContent, luxCheerioParserOptions);
178
213
 
179
- const result = new CheerioInfo(content);
214
+ const result = new CheerioInfo(newContent);
180
215
 
181
216
  $(selector).each(function (i, elem) {
182
217
  const attrNameNoBinding = attrName;
218
+ let updated = false;
219
+
183
220
  if ($(elem).attr(attrNameNoBinding)) {
184
221
  $(elem).removeAttr(attrNameNoBinding);
185
- result.updated = true;
222
+ updated = true;
186
223
  }
187
224
 
188
225
  const attrNameDataBinding = '[' + attrName + ']';
189
226
  if ($(elem).attr(attrNameDataBinding)) {
190
227
  $(elem).removeAttr(attrNameDataBinding);
191
- result.updated = true;
228
+ updated = true;
192
229
  }
193
230
 
194
231
  const attrNameTwoWayBinding = '[(' + attrName + ')]';
195
232
  if ($(elem).attr(attrNameTwoWayBinding)) {
196
233
  $(elem).removeAttr(attrNameTwoWayBinding);
197
- result.updated = true;
234
+ updated = true;
198
235
  }
199
236
 
200
237
  const attrNameEventBinding = '(' + attrName + ')';
201
238
  if ($(elem).attr(attrNameEventBinding)) {
202
239
  $(elem).removeAttr(attrNameEventBinding);
240
+ updated = true;
241
+ }
242
+
243
+ if (updated) {
203
244
  result.updated = true;
204
245
  }
205
246
  });
206
247
 
207
248
  if (result.updated) {
208
249
  result.content = $.xml();
250
+ result.content = postProcessing(result.content);
209
251
  }
210
252
 
211
253
  return result;
212
254
  }
255
+
256
+ function preProcessing(content: string) {
257
+ return replaceAll(content, '=""', `="${emptyPlaceholderToken}"`);
258
+ }
259
+
260
+ function postProcessing(content: string) {
261
+ let resultContent = content;
262
+
263
+ // Entferne alle leeren Werte die von Cheerio hinzugefügt wurden.
264
+ resultContent = replaceAll(resultContent, `=""`, '');
265
+ // Setze alle Attribute wieder auf leer (="") die initial bereits leer waren oder gezielt auf leer gesetzt wurden.
266
+ resultContent = replaceAll(resultContent, `${emptyPlaceholderToken}`, '');
267
+ // Entferne alle Closing-Tags von den Void-Tags.
268
+ resultContent = replaceAll(resultContent, '</input>', '');
269
+ resultContent = replaceAll(resultContent, '</area>', '');
270
+ resultContent = replaceAll(resultContent, '</br>', '');
271
+ resultContent = replaceAll(resultContent, '</base>', '');
272
+ resultContent = replaceAll(resultContent, '</col>', '');
273
+ resultContent = replaceAll(resultContent, '</embed>', '');
274
+ resultContent = replaceAll(resultContent, '</hr>', '');
275
+ resultContent = replaceAll(resultContent, '</img>', '');
276
+ resultContent = replaceAll(resultContent, '</link>', '');
277
+ resultContent = replaceAll(resultContent, '</meta>', '');
278
+ resultContent = replaceAll(resultContent, '</param>', '');
279
+ resultContent = replaceAll(resultContent, '</source>', '');
280
+ resultContent = replaceAll(resultContent, '</track>', '');
281
+ resultContent = replaceAll(resultContent, '</wbr>', '');
282
+
283
+ return resultContent;
284
+ }
285
+
286
+ const getAllAttributes = function (node) {
287
+ return node.attributes || Object.keys(node.attribs).map((name) => ({ name, value: node.attribs[name] }));
288
+ };