Fix lowering of data- with HTML for components

This was missed in the previous attempt to fix data- attributes. HTML
wasn't being translated into the correct IR.
\n\nCommit migrated from 239a88d973
This commit is contained in:
Ryan Nowak 2019-01-01 19:22:41 -08:00
parent 724178680f
commit f741241171
1 changed files with 21 additions and 0 deletions

View File

@ -1255,6 +1255,27 @@ namespace Microsoft.AspNetCore.Razor.Language
public override void VisitMarkupTextLiteral(MarkupTextLiteralSyntax node)
{
if (_builder.Current is HtmlAttributeIntermediateNode)
{
// This can happen inside a data- attribute
_builder.Push(new HtmlAttributeValueIntermediateNode()
{
Prefix = string.Empty,
Source = BuildSourceSpanFromNode(node),
});
_builder.Add(new IntermediateToken()
{
Content = node.GetContent() ?? string.Empty,
Kind = TokenKind.Html,
Source = BuildSourceSpanFromNode(node),
});
_builder.Pop();
return;
}
var context = node.GetSpanContext();
if (context != null && context.ChunkGenerator == SpanChunkGenerator.Null)
{