Refactor editor attribute sorting logic#453
Conversation
stijnpotters1
commented
Apr 23, 2026
…ure mandatory attributes are handled
|
| const starts = [...configXml.matchAll(/<[Aa]dapter\b/g)].map((m) => m.index) | ||
|
|
||
| if (adapterIndex >= starts.length) return configXml | ||
|
|
||
| const start = starts[adapterIndex] | ||
| const closeRegex = /<\/[Aa]dapter>/g |
There was a problem hiding this comment.
Instead of doing 2 regex executions for the same thing, is it possible to save the tag name with correct capitalisation so the closing tag can be be something like </${closingTagName}>?
There was a problem hiding this comment.
The reason is that using regex is discouraged since the javascript regex engine needs to be called in separate instances through the browser's execution of the code. This is understood to be slower than plain string search or replacement and in our case would mean getting the correct name from the first regex (as a capture group result?) and using that for the closing tag
| 'flow:x': String(roundedX), | ||
| 'flow:y': String(roundedY), | ||
| 'flow:width': String(width), | ||
| ...(height === undefined ? {} : { 'flow:height': String(height) }), |
There was a problem hiding this comment.
height should be null if not found in node instead of undefined
| @Override public void startDTD(String name, String publicId, String systemId) {} | ||
| @Override public void endDTD() {} | ||
| @Override public void startEntity(String name) {} | ||
| @Override public void endEntity(String name) {} | ||
| @Override public void startCDATA() {} | ||
| @Override public void endCDATA() {} |
There was a problem hiding this comment.
So many empty overriden methods, are you sure this is the way to go?


