feature: Argument labels will end with a :, unless they end with ?, : or . already (#355)

This commit is contained in:
James Read
2024-07-15 09:24:54 +01:00
committed by GitHub
parent bb90a5da92
commit 20c4423799

View File

@@ -74,7 +74,15 @@ class ArgumentForm extends window.HTMLElement {
createDomLabel (arg) {
const domLbl = document.createElement('label')
domLbl.innerText = arg.title + ':'
const lastChar = arg.title.charAt(arg.title.length - 1)
if (lastChar === '?' || lastChar === '.' || lastChar === ':') {
domLbl.innerHTML = arg.title
} else {
domLbl.innerHTML = arg.title + ':'
}
domLbl.setAttribute('for', arg.name)
return domLbl