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:
parent
724178680f
commit
f741241171
|
|
@ -1255,6 +1255,27 @@ namespace Microsoft.AspNetCore.Razor.Language
|
||||||
|
|
||||||
public override void VisitMarkupTextLiteral(MarkupTextLiteralSyntax node)
|
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();
|
var context = node.GetSpanContext();
|
||||||
if (context != null && context.ChunkGenerator == SpanChunkGenerator.Null)
|
if (context != null && context.ChunkGenerator == SpanChunkGenerator.Null)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue