Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed Internal Attributes #111 #112

Merged
merged 8 commits into from
Apr 30, 2020
Merged
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions src/bunit.web/Rendering/Internal/Htmlizer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ internal class Htmlizer
"area", "base", "br", "col", "embed", "hr", "img", "input", "link", "meta", "param", "source", "track", "wbr"
};

private const string BLAZOR_INTERNAL_ATTR_PREFIX = "__internal_";

public const string BLAZOR_ATTR_PREFIX = "blazor:";
public const string ELEMENT_REFERENCE_ATTR_NAME = BLAZOR_ATTR_PREFIX + "elementreference";

Expand Down Expand Up @@ -222,6 +224,13 @@ private static int RenderAttributes(
{
case bool flag when flag:
result.Add(" ");
if (frame.AttributeName.StartsWith(BLAZOR_INTERNAL_ATTR_PREFIX, StringComparison.Ordinal))
{
// NOTE: this was added to make it more obvious
// that this is a generated/special blazor attribute
// for internal usage
result.Add(BLAZOR_ATTR_PREFIX);
}
result.Add(frame.AttributeName);
break;
samtrion marked this conversation as resolved.
Show resolved Hide resolved
case string value:
Expand Down