Skip to content

Commit 0967acc

Browse files
authored
Fix string split on ':' only split on first (#408)
* Fix string split on ':' only split on first Say the validation rule `date_format:!Y-m-d H:i:s` was used. That would parse to the badge containing "Format: !Y-m-d H i s", stripping the required ":"'s. This fixes that by only splitting on the first ":" and keeping the remaining string as is, including ":". * remove semi colons
1 parent 6d9e4b1 commit 0967acc

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

ui/src/components/elements/ApiInfoRules.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,9 @@ export default function ApiInfoRules(props: Props) {
1212
const { rules, mainRule } = props
1313
const StyledRule = (rule: any): JSX.Element => {
1414
const theRule = rule.rule
15-
const split = theRule.split(':')
15+
const _tmp = theRule.split(':')
16+
const split = _tmp.splice(0, 1)
17+
_tmp.length && split.push(_tmp.join(':'))
1618

1719
if (theRule == 'url') {
1820
return (

0 commit comments

Comments
 (0)