Quick tag helper fixes
- build break due to invalid XML comment in `TagHelperOutputExtensions` - nit: correct "overridden" spelling in same comment - use `TagHelperOutputExtensions` in `TextAreaTagHelper`
This commit is contained in:
parent
2729cdc9b7
commit
c8813fe81d
|
|
@ -78,13 +78,13 @@ namespace Microsoft.AspNet.Mvc.TagHelpers
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Merges the given <see cref="tagBuilder"/>'s <see cref="TagBuilder.Attributes"/> into the
|
/// Merges the given <paramref name="tagBuilder"/>'s <see cref="TagBuilder.Attributes"/> into the
|
||||||
/// <paramref name="tagHelperOutput"/>.
|
/// <paramref name="tagHelperOutput"/>.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="tagHelperOutput">The <see cref="TagHelperOutput"/> this method extends.</param>
|
/// <param name="tagHelperOutput">The <see cref="TagHelperOutput"/> this method extends.</param>
|
||||||
/// <param name="tagBuilder">The <see cref="TagBuilder"/> to merge attributes from.</param>
|
/// <param name="tagBuilder">The <see cref="TagBuilder"/> to merge attributes from.</param>
|
||||||
/// <remarks>Existing <see cref="TagHelperOutput.Attributes"/> on the given <paramref name="tagHelperOutput"/>
|
/// <remarks>Existing <see cref="TagHelperOutput.Attributes"/> on the given <paramref name="tagHelperOutput"/>
|
||||||
/// are not overriden; "class" attributes are merged with spaces.</remarks>
|
/// are not overridden; "class" attributes are merged with spaces.</remarks>
|
||||||
public static void MergeAttributes(this TagHelperOutput tagHelperOutput, TagBuilder tagBuilder)
|
public static void MergeAttributes(this TagHelperOutput tagHelperOutput, TagBuilder tagBuilder)
|
||||||
{
|
{
|
||||||
foreach (var attribute in tagBuilder.Attributes)
|
foreach (var attribute in tagBuilder.Attributes)
|
||||||
|
|
|
||||||
|
|
@ -40,18 +40,11 @@ namespace Microsoft.AspNet.Mvc.TagHelpers
|
||||||
|
|
||||||
if (tagBuilder != null)
|
if (tagBuilder != null)
|
||||||
{
|
{
|
||||||
output.SelfClosing = false;
|
// Overwrite current Content to ensure expression result round-trips correctly.
|
||||||
|
|
||||||
// TODO: Use infrastructure from PR #1322 to copy from tagBuilder.
|
|
||||||
foreach (var attribute in tagBuilder.Attributes)
|
|
||||||
{
|
|
||||||
if (!output.Attributes.ContainsKey(attribute.Key))
|
|
||||||
{
|
|
||||||
output.Attributes.Add(attribute.Key, attribute.Value);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
output.Content = tagBuilder.InnerHtml;
|
output.Content = tagBuilder.InnerHtml;
|
||||||
|
|
||||||
|
output.MergeAttributes(tagBuilder);
|
||||||
|
output.SelfClosing = false;
|
||||||
output.TagName = tagBuilder.TagName;
|
output.TagName = tagBuilder.TagName;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue