@@ -3405,4 +3405,76 @@ Para más información, consulta "[AUTOTITLE](/path)".
34053405 expect ( fix ( blank , 'fr' ) ) . toBe ( blank )
34063406 } )
34073407 } )
3408+
3409+ describe ( 'data keyword glued to variables or reusables' , ( ) => {
3410+ test ( 'es: {% datos.variables. and a stray word between datos and variables' , ( ) => {
3411+ expect ( fix ( '{% datos.variables.product.company_short %}' , 'es' ) ) . toBe (
3412+ '{% data variables.product.company_short %}' ,
3413+ )
3414+ expect ( fix ( 'un {% datos existente variables.copilot.x %} de su' , 'es' ) ) . toBe (
3415+ 'un {% data variables.copilot.x %} de su' ,
3416+ )
3417+ const ok = '{% data variables.product.company_short %}'
3418+ expect ( fix ( ok , 'es' ) ) . toBe ( ok )
3419+ } )
3420+
3421+ test ( 'zh: {% data变量. becomes {% data variables.' , ( ) => {
3422+ expect ( fix ( '{% data变量.dependabot.github_presets %} 是规则' , 'zh' ) ) . toBe (
3423+ '{% data variables.dependabot.github_presets %} 是规则' ,
3424+ )
3425+ const ok = '{% data variables.dependabot.github_presets %}'
3426+ expect ( fix ( ok , 'zh' ) ) . toBe ( ok )
3427+ } )
3428+
3429+ test ( 'zh: space-separated data变量 restores the dot' , ( ) => {
3430+ expect ( fix ( '{% data变量 dependabot.github_presets %} 是规则' , 'zh' ) ) . toBe (
3431+ '{% data variables.dependabot.github_presets %} 是规则' ,
3432+ )
3433+ expect (
3434+ fix (
3435+ '{% data变量 dependabot.github_presets %} 是规则' ,
3436+ 'zh' ,
3437+ '{% data variables.dependabot.github_presets %} are rules' ,
3438+ ) ,
3439+ ) . toBe ( '{% data variables.dependabot.github_presets %} 是规则' )
3440+ } )
3441+
3442+ test ( 'zh: space-separated data变量 with only whitespace-control data tags' , ( ) => {
3443+ expect (
3444+ fix (
3445+ '{%- data变量 dependabot.github_presets %} 是规则' ,
3446+ 'zh' ,
3447+ '{%- data variables.dependabot.github_presets %} are rules' ,
3448+ ) ,
3449+ ) . toBe ( '{%- data variables.dependabot.github_presets %} 是规则' )
3450+ } )
3451+ } )
3452+
3453+ describe ( 'octicon missing space before quoted name' , ( ) => {
3454+ test ( 'restores the space, including after curly-quote normalization' , ( ) => {
3455+ expect ( fix ( '{% octicon“kebab-horizontal” aria-label=“图标” %}' , 'zh' ) ) . toBe (
3456+ '{% octicon "kebab-horizontal" aria-label="图标" %}' ,
3457+ )
3458+ expect ( fix ( '{% octicon"pulse" aria-hidden="true" %}' , 'ja' ) ) . toBe (
3459+ '{% octicon "pulse" aria-hidden="true" %}' ,
3460+ )
3461+ } )
3462+
3463+ test ( 'leaves a correct octicon unchanged' , ( ) => {
3464+ const ok = '{% octicon "pulse" aria-hidden="true" %}'
3465+ expect ( fix ( ok , 'ja' ) ) . toBe ( ok )
3466+ } )
3467+ } )
3468+
3469+ describe ( 'Korean data keyword and tag names' , ( ) => {
3470+ test ( 'fixes {%- dada and translated eclipse and desktop tags' , ( ) => {
3471+ expect ( fix ( '{%- dada variables.product.prodname_actions %}' , 'ko' ) ) . toBe (
3472+ '{%- data variables.product.prodname_actions %}' ,
3473+ )
3474+ expect ( fix ( '{% 이클립스 %}x{% endeclipse %}' , 'ko' ) ) . toBe ( '{% eclipse %}x{% endeclipse %}' )
3475+ expect ( fix ( '{%- 데스크톱 %}x{% enddesktop %}' , 'ko' ) ) . toBe ( '{%- desktop %}x{% enddesktop %}' )
3476+ const ok = '{% data variables.product.prodname_actions %}'
3477+ expect ( fix ( ok , 'ko' ) ) . toBe ( ok )
3478+ } )
3479+ } )
34083480} )
0 commit comments