parent
e8a584729f
commit
9fc340553f
|
|
@ -712,35 +712,27 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy
|
||||||
|
|
||||||
AcceptAndMoveNext();
|
AcceptAndMoveNext();
|
||||||
|
|
||||||
var bookmark = CurrentStart.AbsoluteIndex;
|
AcceptWhile(IsSpacingToken(includeNewLines: false));
|
||||||
var tokens = ReadWhile(IsSpacingToken(includeNewLines: true));
|
if (At(SyntaxKind.CloseAngle) ||
|
||||||
var selfClosing = At(SyntaxKind.ForwardSlash);
|
(At(SyntaxKind.ForwardSlash) && NextIs(SyntaxKind.CloseAngle)))
|
||||||
if (selfClosing)
|
|
||||||
{
|
{
|
||||||
tagMode = MarkupTagMode.SelfClosing;
|
if (At(SyntaxKind.ForwardSlash))
|
||||||
Accept(tokens);
|
{
|
||||||
Assert(SyntaxKind.ForwardSlash);
|
tagMode = MarkupTagMode.SelfClosing;
|
||||||
AcceptAndMoveNext();
|
AcceptAndMoveNext(); // '/'
|
||||||
bookmark = CurrentStart.AbsoluteIndex;
|
}
|
||||||
tokens = ReadWhile(IsSpacingToken(includeNewLines: true));
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!At(SyntaxKind.CloseAngle))
|
AcceptAndMoveNext(); // '>'
|
||||||
|
SpanContext.EditHandler.AcceptedCharacters = AcceptedCharactersInternal.None;
|
||||||
|
}
|
||||||
|
else
|
||||||
{
|
{
|
||||||
Context.Source.Position = bookmark;
|
|
||||||
NextToken();
|
|
||||||
Context.ErrorSink.OnError(
|
Context.ErrorSink.OnError(
|
||||||
RazorDiagnosticFactory.CreateParsing_TextTagCannotContainAttributes(
|
RazorDiagnosticFactory.CreateParsing_TextTagCannotContainAttributes(
|
||||||
new SourceSpan(textLocation, contentLength: 4 /* text */)));
|
new SourceSpan(textLocation, contentLength: 4 /* text */)));
|
||||||
|
|
||||||
RecoverTextTag();
|
RecoverTextTag();
|
||||||
}
|
}
|
||||||
else
|
|
||||||
{
|
|
||||||
Accept(tokens);
|
|
||||||
TryAccept(SyntaxKind.CloseAngle);
|
|
||||||
SpanContext.EditHandler.AcceptedCharacters = AcceptedCharactersInternal.None;
|
|
||||||
}
|
|
||||||
|
|
||||||
isWellFormed = true;
|
isWellFormed = true;
|
||||||
SpanContext.ChunkGenerator = SpanChunkGenerator.Null;
|
SpanContext.ChunkGenerator = SpanChunkGenerator.Null;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue