Merge pull request #2508 from amaanq/render-space
fix(render): only output SPACE for strings that are just a space
This commit is contained in:
commit
eb3c2b378a
1 changed files with 2 additions and 1 deletions
|
|
@ -1538,7 +1538,7 @@ impl Generator {
|
|||
} else {
|
||||
'special_chars: {
|
||||
let replacement = match c {
|
||||
' ' => "SPACE",
|
||||
' ' if name.len() == 1 => "SPACE",
|
||||
'~' => "TILDE",
|
||||
'`' => "BQUOTE",
|
||||
'!' => "BANG",
|
||||
|
|
@ -1613,6 +1613,7 @@ impl Generator {
|
|||
break 'special_chars;
|
||||
}
|
||||
'0'..='9' | 'a'..='z' | 'A'..='Z' | '_' => unreachable!(),
|
||||
' ' => break 'special_chars,
|
||||
};
|
||||
if !result.is_empty() && !result.ends_with("_") {
|
||||
result.push('_');
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue