Skip to content

Commit

Permalink
Auto replace space, "-", and "_"
Browse files Browse the repository at this point in the history
  • Loading branch information
DilemmaGX committed Dec 12, 2023
1 parent 0fac1a8 commit 13b4161
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 1 addition & 1 deletion index.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
</head>

<body>
<div style="max-width: 600px; margin: auto; margin-top: 50px;">
<div style="max-width: 600px; margin: auto; margin-top: 30px;">
<div align="middle">
<h1>Static Badge Maker</h1>
<a href="http://github.com/dilemmaGX/shields-maker"><img alt="GitHub License"
Expand Down
3 changes: 3 additions & 0 deletions src/static.js
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,9 @@ function auto() {
var o_ad = document.getElementById("o_ad");
var o_rst = document.getElementById("o_rst");

left = left.replace(/[-_]/g, m => m === '-' ? '--' : '__').replace(/\s/g, '_');
right = right.replace(/[-_]/g, m => m === '-' ? '--' : '__').replace(/\s/g, '_');

if (color == "" || color == undefined) {
color = "default";
}
Expand Down

0 comments on commit 13b4161

Please sign in to comment.