Whitespace injection after variable interpolation
See original GitHub issuevue & vue-i18n version
vue: 2.5.21, vue-i18n: 8. 7. 0
Reproduction Link
Steps to reproduce
Using advanced interpolation, we have this i18n tag
<i18n
path="HOME.INTRODUCTION.CERTIFICATE_INFO"
tag="p"
class="introduction"
>
<span place="userName">
{{ userName }}
</span>
<strong
class="highligth-text"
place="baseCertificate"
>
{{ $t('HOME.INTRODUCTION.BASE_CERTIFICATE') }}
</strong>
<strong
class="highligth-text"
place="personalizedCertificate"
>
{{ $t('HOME.INTRODUCTION.PERSONALIZED_CERTIFICATE') }}
</strong>
</i18n>
And this language object
export const es = {
HOME: {
INTRODUCTION: {
TITLE: 'Necesito un certificado',
CERTIFICATE_INFO:
'Hola {userName}, desde aquí podras generar',
BASE_CERTIFICATE: 'certificado base',
PERSONALIZED_CERTIFICATE: 'certificado personalizado'
},
SUBTITLE: 'Selecciona que tipo de certificado quieres generar para ti.'
}
}
What is Expected?
In the CERTIFICATE_INFO
interpolation we expect that the component just not inject a white space after the variable in brackets.
Hola Frederick, desde aquí....
What is actually happening?
Actually, the library is adding a white space after the variable in brackets.
Hola Frederick , desde aquí....
Comment
I guess, this could be a nice behaviour, but the interpolation should detect if the next character is a dot or a comma
Issue Analytics
- State:
- Created 5 years ago
- Reactions:2
- Comments:5 (2 by maintainers)
Top Results From Across the Web
use a variable with whitespace Perl - Stack Overflow
No, since the default glob() delimits with white space. use File::Glob qw{ :bsd_glob ); to replace the default with one that allows white...
Read more >String interpolation - CloudBees Documentation
Groovy string interpolation can inject rogue commands into command interpreters via special characters. Using Groovy string interpolation for user-controlled ...
Read more >Interpolation - Pug
The tag interpolation syntax is especially useful for inline tags, where whitespace before and after the tag is significant. By default, however, Pug...
Read more >bash - How to send a command with arguments without spaces?
Consecutive separator characters that are whitespace are treated as a single separator, so the result of the expansion of cat${IFS}file.txt is ...
Read more >string interpolation - format string output - Microsoft Learn
To identify a string literal as an interpolated string, prepend it with the $ symbol. You can't have any white space between the...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Sorry, late for a reply 🙇
This is due to the behavior of Vue’s template compiler. You need to remove the space.
Related to #623 and #963, seems like the only solution is to trim whitespace in some way external to this project.