@@ -180,15 +180,13 @@ public override void Process(TagHelperContext context, TagHelperOutput output)
180
180
height = ( originalHeight / originalWidth ) * width ;
181
181
}
182
182
183
- #region Autogenerate alt text
183
+ #region Autogenerate alt text if unspecfied
184
184
if ( string . IsNullOrWhiteSpace ( ImgAlt ) )
185
185
{
186
186
output . Attributes . Add ( "alt" , GetImageAltText ( MediaItem ) ) ;
187
187
}
188
- #endregion
189
- #region Use the alt text the user specified
190
- else
191
- {
188
+ else
189
+ {
192
190
output . Attributes . Add ( "alt" , ImgAlt ) ;
193
191
}
194
192
#endregion
@@ -201,18 +199,16 @@ public override void Process(TagHelperContext context, TagHelperOutput output)
201
199
202
200
imgSrc = AddQueryToUrl ( FileSource , "width" , width . ToString ( ) ) ;
203
201
204
- #region Autogenerate alt text
202
+ #region Autogenerate alt text if unspecfied
205
203
if ( string . IsNullOrWhiteSpace ( ImgAlt ) )
206
204
{
207
205
output . Attributes . Add ( "alt" , GetImageAltText ( FileSource ) ) ;
208
206
}
209
- #endregion
210
- #region Use the alt text the user specified
211
- else
212
- {
213
- output . Attributes . Add ( "alt" , ImgAlt ) ;
214
- }
215
- #endregion
207
+ else
208
+ {
209
+ output . Attributes . Add ( "alt" , ImgAlt ) ;
210
+ }
211
+ #endregion
216
212
217
213
#region If width & height are not defined then return a basic <img> with just a src, alt & class (if provided)
218
214
if ( ImgWidth == 0 || ImgHeight == 0 )
0 commit comments