File tree Expand file tree Collapse file tree 4 files changed +21
-1
lines changed
src/GovUk.Frontend.AspNetCore/TagHelpers Expand file tree Collapse file tree 4 files changed +21
-1
lines changed Original file line number Diff line number Diff line change 55 branches :
66 - dev
77 - main
8+ - v*
89 tags :
910 - v*
1011 paths-ignore :
Original file line number Diff line number Diff line change 11# Changelog
22
3+ ## 2.2.1
4+
5+ ### Fixes
6+
7+ #### Attribute encoding
8+ Newly-refactored tag helpers now correctly encode their attributes.
9+
310## 2.2.0
411
512Targets GOV.UK Frontend v5.2.0.
Original file line number Diff line number Diff line change @@ -98,7 +98,7 @@ await output.GetChildContentAsync() :
9898
9999 if ( validationMessage != null )
100100 {
101- resolvedContent = new HtmlString ( HtmlEncoder . Default . Encode ( validationMessage ) ) ;
101+ resolvedContent = validationMessage . EncodeHtml ( ) ;
102102 }
103103 }
104104
Original file line number Diff line number Diff line change 1+ using System . Diagnostics . CodeAnalysis ;
2+ using System . Text . Encodings . Web ;
3+ using Microsoft . AspNetCore . Html ;
4+
5+ namespace GovUk . Frontend . AspNetCore . TagHelpers ;
6+
7+ internal static class Extensions
8+ {
9+ [ return : NotNullIfNotNull ( nameof ( value ) ) ]
10+ public static IHtmlContent ? EncodeHtml ( this string ? value ) =>
11+ value is not null ? new HtmlString ( HtmlEncoder . Default . Encode ( value ) ) : null ;
12+ }
You can’t perform that action at this time.
0 commit comments