Skip to content

Commit

Permalink
prepend and append spaces to text, if starts with a number
Browse files Browse the repository at this point in the history
  • Loading branch information
nbarlowATI committed Dec 12, 2022
1 parent 6ae3700 commit ae8e072
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions frontend/src/components/utils.js
Expand Up @@ -27,6 +27,11 @@ function jsonToMermaid(in_json) {
}

function makeBox(text, shape) {
// check if string starts with a number, and if so, prepend a space
// to avoid getting a weird unicode character instead
if (text.match(/^\d/)) {
text = " " + text + " ";
}
if (text.length > configData["BOX_NCHAR"]) {
text = text.substring(0, configData["BOX_NCHAR"] - 3) + "...";
} else {
Expand Down

0 comments on commit ae8e072

Please sign in to comment.