Skip to content

Commit

Permalink
【fix】Group parts of the regex together to make the intended operator …
Browse files Browse the repository at this point in the history
…precedence explicit.
  • Loading branch information
songyumeng committed Feb 20, 2024
1 parent 590dfeb commit 613a054
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/common/color-picker/ColorPicker.vue
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ export default class ColorPicker extends Vue {
hex: color
};
} else if (/^rgba.+/.test(color)) {
const rgba = color.replace(/^rgba?\(|\s+|\)$/g, '').split(',');
const rgba = color.replace(/(?:^rgba?)\(|\s+|\)$/g, '').split(',');
const hex = `#${((1 << 24) + (parseInt(rgba[0]) << 16) + (parseInt(rgba[1]) << 8) + parseInt(rgba[2]))
.toString(16)
.slice(1)}`;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -314,7 +314,7 @@ class SmCoordinateConversion extends Mixins(MapGetter, Control, Theme, BaseCard)
}
reverseCoordinateFormat(value: string = this.inputValue, formatOption: FormatOption, format?: string) {
value = value.replace(/^\s+|\s+$ /, '');
value = value.replace(/^(?:\s+|\s+)$ /, '');
if (!value || !formatOption) {
this.viewModel._clearMarker();
return null;
Expand Down

0 comments on commit 613a054

Please sign in to comment.