@@ -187,6 +187,37 @@ mapping: !<tag:example.test,2026:object>
187187 $result.mapping.name | Should - Be ' safe'
188188 }
189189
190+ It ' decodes percent escapes in expanded representation tags' {
191+ $escaped = Get-TestYamlRepresentationRoot - Yaml (
192+ " %TAG !e! tag:example.com,2000:app/`n --- !e!tag%21 value"
193+ )
194+ $multibyte = Get-TestYamlRepresentationRoot - Yaml (
195+ " %TAG !e! tag:example.com,2000:app/`n --- !e!caf%C3%A9 value"
196+ )
197+
198+ $escaped.Tag | Should - Be ' tag:example.com,2000:app/tag!'
199+ $escaped.HasUnknownTag | Should - BeTrue
200+ $multibyte.Tag | Should - Be (
201+ ' tag:example.com,2000:app/caf{0}' -f [char ] 0x00E9
202+ )
203+ $multibyte.HasUnknownTag | Should - BeTrue
204+ }
205+
206+ It ' retains unknown local and global tags before neutral value projection' {
207+ $local = Get-TestYamlRepresentationRoot - Yaml ' !local value'
208+ $global = Get-TestYamlRepresentationRoot - Yaml (
209+ ' !<tag:example.test,2026:object> value'
210+ )
211+
212+ $local.Tag | Should - Be ' !local'
213+ $local.HasUnknownTag | Should - BeTrue
214+ $global.Tag | Should - Be ' tag:example.test,2026:object'
215+ $global.HasUnknownTag | Should - BeTrue
216+ (' !local value' | ConvertFrom-Yaml ) | Should - Be ' value'
217+ (' !<tag:example.test,2026:object> value' | ConvertFrom-Yaml ) |
218+ Should - Be ' value'
219+ }
220+
190221 It ' preserves repeated collection references' {
191222 $result = @'
192223source: &source
0 commit comments