5 Commits
Author SHA1 Message Date
ds5678 3054d55383 Bump version 2024-07-06 23:51:13 -04:00
ds5678 af03da5302 Update NuGet references 2024-07-06 23:49:39 -04:00
ds5678 55216fea17 Implement IDisposable 2024-07-06 23:45:56 -04:00
ds5678 5e86c28d6c Update documentation 2024-07-06 23:44:24 -04:00
Jeremy Pritts 61ca771631 Ref Struct Interfaces (#1)
* Push experimental changes

* Remove obsolete contextmenu

* Update source generation to use ref struct interfaces
2024-07-06 18:24:25 -04:00
266 changed files with 9432 additions and 12353 deletions

No files matched your search

@@ -1,9 +1,10 @@
<Project Sdk="Microsoft.NET.Sdk.Web">
<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<TargetFramework>net9.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<LangVersion>preview</LangVersion>
</PropertyGroup>
<ItemGroup>
@@ -12,9 +13,9 @@
</ItemGroup>
<ItemGroup>
<PackageReference Include="AngleSharp" Version="1.0.7" />
<PackageReference Include="AngleSharp" Version="1.1.2" />
<PackageReference Include="AssetRipper.Text.SourceGeneration" Version="1.1.0" />
<PackageReference Include="Microsoft.CodeAnalysis.CSharp" Version="4.8.0" />
<PackageReference Include="Microsoft.CodeAnalysis.CSharp" Version="4.10.0" />
</ItemGroup>
</Project>
+2 -2
View File
@@ -9,7 +9,7 @@ internal static class Bootstrap
Rel = "stylesheet",
Href = "https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css",
Integrity = "sha384-T3c6CoIi6uLrA9TneNEoa7RxnatzjcDSCmG1MXxSR1GAsXEV/Dwwykc2MPK8M2HN",
Crossorigin = "anonymous"
CrossOrigin = "anonymous"
}.Close();
}
@@ -19,7 +19,7 @@ internal static class Bootstrap
{
Src = "https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.js",
Integrity = "sha384-C6RzsynM9kWDrMNeT87bh95OGNyZPhcTNXj1NW7RuBCsyN/o0jlpcV8Qyq46cDfL",
Crossorigin = "anonymous"
CrossOrigin = "anonymous"
}.Close();
}
}
@@ -12,7 +12,14 @@ namespace AssetRipper.Text.Html.Converter;
internal static partial class HtmlConverter
{
private static IReadOnlyDictionary<string, ModelElement> ElementDictionary { get; } = HtmlJsonLoader.Load();
static HtmlConverter()
{
HtmlJsonLoader.Load(out List<HtmlAttribute> globalAttributes, out List<HtmlAttribute> localAttributes, out List<ModelElement> elements);
ElementDictionary = elements.ToDictionary(t => t.Name, t => t);
}
private static IReadOnlyDictionary<string, ModelElement> ElementDictionary { get; }
//This works perfect, except for whitespace removal. That could be improved.
//Currently, there's a lot of `writer.Write(' ');` calls that get generated,
@@ -53,7 +60,7 @@ internal static partial class HtmlConverter
}
else
{
writer.Write($"HtmlElement(writer, {ToLiteral(node.LocalName)})");
writer.Write($"{nameof(CustomHtmlElement)}(writer, {ToLiteral(node.LocalName)})");
}
WriteAttributes(writer, node.Attributes, elementData);
@@ -144,7 +151,7 @@ internal static partial class HtmlConverter
if (elementData is not null && elementData.Attributes.TryGetValue(attribute.LocalName, out HtmlAttribute? attributeData))
{
writer.Write('.');
writer.Write(attributeData.FluentMethodName);
writer.Write(attributeData.GetFluentMethodName(elementData.ClassName));
writer.Write('(');
}
else
+108 -41
View File
@@ -12,11 +12,58 @@ internal class Program
static void Main()
{
IReadOnlyDictionary<string, HtmlElement> elements = HtmlJsonLoader.Load();
HtmlJsonLoader.Load(out List<HtmlAttribute> globalAttributes, out List<HtmlAttribute> localAttributes, out List<HtmlElement> elements);
Directory.CreateDirectory(GeneratedFolder);
foreach (HtmlElement element in elements.Values)
// Global attributes
{
IndentedTextWriter writer = IndentedTextWriterFactory.Create(GeneratedFolder, "IGlobalAttributes");
writer.WriteGeneratedCodeWarning();
writer.WriteLineNoTabs();
writer.WriteLine("#nullable enable");
writer.WriteLineNoTabs();
writer.WriteFileScopedNamespace("AssetRipper.Text.Html");
writer.WriteLineNoTabs();
writer.WriteLine("public interface IGlobalAttributes<TSelf> where TSelf : IGlobalAttributes<TSelf>, allows ref struct");
using (new CurlyBrackets(writer))
{
for (int i = 0; i < globalAttributes.Count; i++)
{
HtmlAttribute attribute = globalAttributes[i];
if (i > 0)
{
writer.WriteLineNoTabs();
}
writer.WriteLine($"string {attribute.PropertyName} {{ set; }}");
writer.WriteLineNoTabs();
writer.WriteLine($"TSelf {attribute.FluentMethodName}(string? value = null);");
}
}
}
// Local attributes
foreach (HtmlAttribute attribute in localAttributes)
{
IndentedTextWriter writer = IndentedTextWriterFactory.Create(GeneratedFolder, attribute.InterfaceName);
writer.WriteGeneratedCodeWarning();
writer.WriteLineNoTabs();
writer.WriteLine("#nullable enable");
writer.WriteLineNoTabs();
writer.WriteFileScopedNamespace("AssetRipper.Text.Html");
writer.WriteLineNoTabs();
writer.WriteLine($"public interface {attribute.InterfaceName}<TSelf> where TSelf : {attribute.InterfaceName}<TSelf>, allows ref struct");
using (new CurlyBrackets(writer))
{
writer.WriteLine($"string {attribute.PropertyName} {{ set; }}");
writer.WriteLineNoTabs();
writer.WriteLine($"TSelf {attribute.FluentMethodName}(string? value = null);");
}
}
foreach (HtmlElement element in elements)
{
IndentedTextWriter writer = IndentedTextWriterFactory.Create(GeneratedFolder, element.ClassName);
@@ -26,7 +73,16 @@ internal class Program
writer.WriteLineNoTabs();
writer.WriteFileScopedNamespace("AssetRipper.Text.Html");
writer.WriteLineNoTabs();
writer.WriteLine($"public readonly ref partial struct {element.ClassName}");
writer.WriteLine($"public readonly ref partial struct {element.ClassName} : IHtmlElement<{element.ClassName}>,");
using (new Indented(writer))
{
foreach (HtmlAttribute attribute in element.Attributes.Values.Where(a => !a.Global))
{
writer.WriteLine($"{attribute.InterfaceName}<{element.ClassName}>,");
}
writer.WriteLine($"IGlobalAttributes<{element.ClassName}>");
}
using (new CurlyBrackets(writer))
{
writer.WriteLine($"private const string ElementName = \"{element.Name}\";");
@@ -40,8 +96,9 @@ internal class Program
}
foreach (HtmlAttribute attribute in element.Attributes.Values)
{
writer.WriteLineNoTabs();
writer.WriteLine($"public string? {attribute.PropertyName}");
string propertyName = attribute.GetPropertyName(element.ClassName);
writer.WriteLineNoTabs();
writer.WriteLine($"public string? {propertyName}");
using (new CurlyBrackets(writer))
{
writer.WriteLine("set");
@@ -52,53 +109,42 @@ internal class Program
writer.WriteLine("writer.Write('\"');");
}
}
writer.WriteLineNoTabs();
writer.WriteLine($"public {element.ClassName} {attribute.FluentMethodName}(string? value = null)");
if (propertyName != attribute.PropertyName)
{
writer.WriteLineNoTabs();
writer.WriteLine($"string {attribute.InterfaceName}<{element.ClassName}>.{attribute.PropertyName}");
using (new CurlyBrackets(writer))
{
writer.WriteLine($"set => {propertyName} = value;");
}
}
string fluentMethodName = attribute.GetFluentMethodName(element.ClassName);
writer.WriteLineNoTabs();
writer.WriteLine($"public {element.ClassName} {fluentMethodName}(string? value = null)");
using (new CurlyBrackets(writer))
{
writer.WriteLine($"{attribute.PropertyName} = value;");
writer.WriteLine($"{attribute.GetPropertyName(element.ClassName)} = value;");
writer.WriteLine("return this;");
}
}
writer.WriteLineNoTabs();
writer.WriteLine($"public {element.ClassName} WithCustomAttribute(string key, string? value = null)");
using (new CurlyBrackets(writer))
{
writer.WriteLine("WriteKey(key);");
writer.WriteLine("WriteValue(value);");
writer.WriteLine("return this;");
}
writer.WriteLineNoTabs();
writer.WriteLine($"public {element.ClassName} WithCustomAttributes(scoped ReadOnlySpan<(string, string?)> attributes)");
using (new CurlyBrackets(writer))
{
writer.WriteLine("foreach ((string key, string? value) in attributes)");
using (new CurlyBrackets(writer))
if (fluentMethodName != attribute.FluentMethodName)
{
writer.WriteLine("WriteKey(key);");
writer.WriteLine("WriteValue(value);");
writer.WriteLineNoTabs();
writer.WriteLine($"{element.ClassName} {attribute.InterfaceName}<{element.ClassName}>.{attribute.FluentMethodName}(string? value = null)");
using (new CurlyBrackets(writer))
{
writer.WriteLine($"return {fluentMethodName}(value);");
}
}
writer.WriteLine("return this;");
}
writer.WriteLineNoTabs();
writer.WriteLine("private void WriteKey(string key)");
using (new CurlyBrackets(writer))
{
writer.WriteLine("writer.Write(' ');");
writer.WriteLine("writer.Write(key);");
}
writer.WriteLineNoTabs();
writer.WriteLine("private void WriteValue(string? value)");
using (new CurlyBrackets(writer))
{
writer.WriteLine("writer.Write(\"=\\\"\");");
writer.WriteLine("writer.Write(value);");
writer.WriteLine("writer.Write('\"');");
}
if (element.IsVoidElement)
{
writer.WriteLineNoTabs();
writer.WriteLine("public void Close() => writer.Write(\"/>\");");
writer.WriteLineNoTabs();
writer.WriteLine($"HtmlElementCloser IHtmlElement<{element.ClassName}>.End() => throw new NotSupportedException();");
}
else
{
@@ -124,6 +170,27 @@ internal class Program
writer.WriteLine("return new HtmlElementCloser(writer, $\"</{ElementName}>\");");
}
}
// IHtmlElement<TSelf> implementation
{
writer.WriteLineNoTabs();
writer.WriteComment("IHtmlElement<TSelf> implementation");
writer.WriteLine($"TextWriter IHtmlElement<{element.ClassName}>.Writer => writer;");
writer.WriteLine($"static {element.ClassName} IHtmlElement<{element.ClassName}>.Create(TextWriter writer) => new(writer);");
writer.WriteLine($"static bool IHtmlElement<{element.ClassName}>.IsVoidElement => {element.IsVoidElement.ToString().ToLowerInvariant()};");
writer.WriteLine($"static string IHtmlElement<{element.ClassName}>.Name => ElementName;");
writer.WriteLine($"static ReadOnlySpan<string> IHtmlElement<{element.ClassName}>.SupportedAttributes => _supportedAttributes;");
writer.WriteLine("private static readonly string[] _supportedAttributes =");
writer.WriteLine('[');
using (new Indented(writer))
{
foreach (HtmlAttribute attribute in element.Attributes.Values)
{
writer.WriteLine($"\"{attribute.Name}\",");
}
}
writer.WriteLine("];");
}
}
Console.WriteLine(element.Name);
}
+49 -4
View File
@@ -3,14 +3,59 @@
public sealed class HtmlAttribute
{
public string Name { get; }
public string InterfaceName => Global ? "IGlobalAttributes" : $"I{PropertyName}Attribute";
public string PropertyName { get; }
public string FluentMethodName { get; }
public bool Global { get; }
public HtmlAttribute(string name, string className)
public HtmlAttribute(string name, bool global)
{
Name = name;
string pascal = HtmlHelper.ConvertKebabToPascal(name);
PropertyName = HtmlHelper.MaybeAppendUnderscore(pascal, className);
FluentMethodName = HtmlHelper.MaybeAppendUnderscore($"With{pascal}", className);
PropertyName = GetPascalName(name);
FluentMethodName = $"With{GetPascalName(name)}";
Global = global;
}
public string GetPropertyName(string elementClassName)
{
return HtmlHelper.MaybeAppendUnderscore(PropertyName, elementClassName);
}
public string GetFluentMethodName(string elementClassName)
{
return HtmlHelper.MaybeAppendUnderscore(FluentMethodName, elementClassName);
}
private static string GetPascalName(string name) => name switch
{
"accesskey" => "AccessKey",
"bgcolor" => "BgColor",
"colspan" => "ColSpan",
"contenteditable" => "ContentEditable",
"crossorigin" => "CrossOrigin",
"datetime" => "DateTime",
"dirname" => "DirName",
"enterkeyhint" => "EnterKeyHint",
"formaction" => "FormAction",
"formenctype" => "FormEncType",
"formmethod" => "FormMethod",
"formnovalidate" => "FormNoValidate",
"formtarget" => "FormTarget",
"hreflang" => "HrefLang",
"inputmode" => "InputMode",
"ismap" => "IsMap",
"itemprop" => "ItemProp",
"playsinline" => "PlaysInline",
"minlength" => "MinLength",
"maxlength" => "MaxLength",
"referrerpolicy" => "ReferrerPolicy",
"rowspan" => "RowSpan",
"spellcheck" => "SpellCheck",
"srclang" => "SrcLang",
"srcset" => "SrcSet",
"srcdoc" => "SrcDoc",
"tabindex" => "TabIndex",
"usemap" => "UseMap",
_ => HtmlHelper.ConvertKebabToPascal(name),
};
}
+4 -4
View File
@@ -7,16 +7,16 @@ public sealed class HtmlElement
public bool IsVoidElement { get; }
public IReadOnlyDictionary<string, HtmlAttribute> Attributes { get; }
public HtmlElement(string name, ReadOnlySpan<string> attributes)
public HtmlElement(string name, IEnumerable<string> attributes, Dictionary<string, HtmlAttribute> attributeDictionary)
{
Name = name;
ClassName = HtmlHelper.ConvertKebabToPascal(name);
IsVoidElement = HtmlHelper.IsVoidElement(name);
Dictionary<string, HtmlAttribute> attributesDictionary = new();
Dictionary<string, HtmlAttribute> dictionary = new();
foreach (string attribute in attributes)
{
attributesDictionary.Add(attribute, new(attribute, ClassName));
dictionary.Add(attribute, attributeDictionary[attribute]);
}
Attributes = attributesDictionary;
Attributes = dictionary;
}
}
+20
View File
@@ -0,0 +1,20 @@
using System.Text.Json;
namespace AssetRipper.Text.Html.Model;
public sealed record HtmlJson(List<KeyValuePair<string, List<string>>> Elements, List<string> GlobalAttributes)
{
public HtmlJson() : this([], [])
{
}
public string ToJson()
{
return JsonSerializer.Serialize(this, HtmlJsonSerializerContext.Default.HtmlJson);
}
public static HtmlJson FromJson(string json)
{
return JsonSerializer.Deserialize(json, HtmlJsonSerializerContext.Default.HtmlJson) ?? new();
}
}
+31 -10
View File
@@ -1,27 +1,48 @@
using System.Text.Json;
namespace AssetRipper.Text.Html.Model;
namespace AssetRipper.Text.Html.Model;
public sealed class HtmlJsonLoader
{
private const string NamespacePrefix = "AssetRipper.Text.Html.Model.";
public static IReadOnlyDictionary<string, HtmlElement> Load()
public static void Load(out List<HtmlAttribute> globalAttributes, out List<HtmlAttribute> localAttributes, out List<HtmlElement> elements)
{
using Stream stream = typeof(HtmlJsonLoader).Assembly.GetManifestResourceStream(NamespacePrefix + "html-elements-attributes.json")
?? throw new NullReferenceException("Could not load resource stream.");
string json = new StreamReader(stream).ReadToEnd();
List<KeyValuePair<string, string[]>> data = JsonSerializer.Deserialize(json, HtmlJsonSerializerContext.Default.ListKeyValuePairStringStringArray)
?? throw new NullReferenceException("Could not deserialize data from the json text.");
HtmlJson data = HtmlJson.FromJson(json);
Dictionary<string, HtmlElement> result = new();
foreach ((string elementName, string[] attributeArray) in data)
Dictionary<string, HtmlAttribute> attributeDictionary = new();
globalAttributes = new();
foreach (string name in data.GlobalAttributes)
{
result.Add(elementName, new HtmlElement(elementName, attributeArray));
HtmlAttribute attribute = new HtmlAttribute(name, true);
attributeDictionary.Add(name, attribute);
globalAttributes.Add(attribute);
}
return result;
localAttributes = new();
foreach ((_, List<string> attributeList) in data.Elements)
{
foreach (string name in attributeList)
{
if (attributeDictionary.ContainsKey(name))
{
continue;
}
HtmlAttribute attribute = new HtmlAttribute(name, false);
attributeDictionary.Add(name, attribute);
localAttributes.Add(attribute);
}
}
elements = new();
foreach ((string elementName, List<string> attributeArray) in data.Elements)
{
elements.Add(new HtmlElement(elementName, attributeArray.Union(data.GlobalAttributes).Order(), attributeDictionary));
}
}
}
@@ -2,7 +2,8 @@
namespace AssetRipper.Text.Html.Model;
[JsonSerializable(typeof(List<KeyValuePair<string, string[]>>))]
[JsonSerializable(typeof(HtmlJson))]
[JsonSourceGenerationOptions(WriteIndented = true)]
internal partial class HtmlJsonSerializerContext : JsonSerializerContext
{
}
File diff suppressed because it is too large. Load diff
@@ -8,7 +8,11 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="AngleSharp" Version="1.0.7" />
<PackageReference Include="AngleSharp" Version="1.1.2" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\AssetRipper.Text.Html.Model\AssetRipper.Text.Html.Model.csproj" />
</ItemGroup>
</Project>
+11 -28
View File
@@ -1,7 +1,7 @@
using AngleSharp;
using AngleSharp.Dom;
using AssetRipper.Text.Html.Model;
using System.Diagnostics.CodeAnalysis;
using System.Text.Json;
namespace AssetRipper.Text.Html.Scraper;
@@ -13,16 +13,19 @@ class Program
static void Main()
{
Dictionary<string, List<string>> elements = Scrape();
SaveAsJson(elements);
HtmlJson elements = Scrape();
string json = elements.ToJson();
File.WriteAllText("html-elements-attributes.json", json);
}
static Dictionary<string, List<string>> Scrape()
static HtmlJson Scrape()
{
Dictionary<string, List<string>> htmlElements = new();
List<string> globalAttributes = new();
ScrapeElements(htmlElements);
ScrapeAttributes(htmlElements);
return htmlElements;
ScrapeAttributes(htmlElements, globalAttributes);
globalAttributes.Sort();
return new HtmlJson(htmlElements.OrderBy(p => p.Key).ToList(), globalAttributes);
}
static void ScrapeElements(Dictionary<string, List<string>> htmlElements)
@@ -43,7 +46,7 @@ class Program
}
}
static void ScrapeAttributes(Dictionary<string, List<string>> htmlElements)
static void ScrapeAttributes(Dictionary<string, List<string>> htmlElements, List<string> globalAttributes)
{
IConfiguration config = Configuration.Default.WithDefaultLoader();
IBrowsingContext context = BrowsingContext.New(config);
@@ -71,10 +74,7 @@ class Program
{
if (element is GlobalAttribute)
{
foreach (List<string> value in htmlElements.Values)
{
value.Add(attr);
}
globalAttributes.Add(attr);
}
else
{
@@ -106,21 +106,4 @@ class Program
return false;
}
}
static void SaveAsJson(Dictionary<string, List<string>> htmlElements)
{
JsonSerializerOptions options = new() { WriteIndented = true };
using (FileStream stream = File.Create("html-elements.json"))
{
IOrderedEnumerable<string> sortedElements = htmlElements.Keys.OrderBy(k => k);
JsonSerializer.Serialize(stream, sortedElements, options);
}
using (FileStream stream = File.Create("html-elements-attributes.json"))
{
IOrderedEnumerable<KeyValuePair<string, List<string>>> sortedElements = htmlElements.OrderBy(e => e.Key);
JsonSerializer.Serialize(stream, sortedElements, options);
}
}
}
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<TargetFramework>net9.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
@@ -10,14 +10,17 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.8.0" />
<PackageReference Include="NUnit" Version="3.14.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.10.0" />
<PackageReference Include="NUnit" Version="4.1.0" />
<PackageReference Include="NUnit3TestAdapter" Version="4.5.0" />
<PackageReference Include="NUnit.Analyzers" Version="3.9.0">
<PackageReference Include="NUnit.Analyzers" Version="4.2.0">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="coverlet.collector" Version="6.0.0" />
<PackageReference Include="coverlet.collector" Version="6.0.2">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
</ItemGroup>
<ItemGroup>
+5 -2
View File
@@ -14,11 +14,14 @@ EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{0D674883-9878-44EE-8280-8D67B6C00076}"
ProjectSection(SolutionItems) = preProject
.editorconfig = .editorconfig
.gitignore = .gitignore
LICENSE.txt = LICENSE.txt
README.md = README.md
EndProjectSection
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AssetRipper.Text.Html.Model", "AssetRipper.Text.Html.Model\AssetRipper.Text.Html.Model.csproj", "{E07CCCBB-D1CA-4AF2-A6C7-C05B3BC43E66}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AssetRipper.Text.Html.Model", "AssetRipper.Text.Html.Model\AssetRipper.Text.Html.Model.csproj", "{E07CCCBB-D1CA-4AF2-A6C7-C05B3BC43E66}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AssetRipper.Text.Html.Converter", "AssetRipper.Text.Html.Converter\AssetRipper.Text.Html.Converter.csproj", "{F7EBBC0A-472A-42DA-B2A2-CC8B42C96CAB}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AssetRipper.Text.Html.Converter", "AssetRipper.Text.Html.Converter\AssetRipper.Text.Html.Converter.csproj", "{F7EBBC0A-472A-42DA-B2A2-CC8B42C96CAB}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
@@ -1,14 +1,15 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<TargetFramework>net9.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<IsAotCompatible>true</IsAotCompatible>
<LangVersion>preview</LangVersion>
<Version>1.0.0</Version>
<Version>2.0.0</Version>
<AssemblyVersion>$(Version)</AssemblyVersion>
<Copyright>Copyright © 2023 ds5678</Copyright>
<Copyright>Copyright © 2023 - 2024 ds5678</Copyright>
<Authors>ds5678</Authors>
<Company>AssetRipper</Company>
@@ -25,9 +26,9 @@
<NoWarn>1591</NoWarn>
</PropertyGroup>
<ItemGroup>
<None Include="README.md" Pack="true" PackagePath="\"/>
<None Include="../README.md" Pack="true" PackagePath="\"/>
</ItemGroup>
</Project>
+36
View File
@@ -0,0 +1,36 @@
namespace AssetRipper.Text.Html;
public static class CustomAttributes
{
public static TSelf WithCustomAttribute<TSelf>(this TSelf element, string key, string? value = null)
where TSelf : IHtmlElement<TSelf>, allows ref struct
{
WriteKey(element.Writer, key);
WriteValue(element.Writer, value);
return element;
}
public static TSelf WithCustomAttributes<TSelf>(this TSelf element, scoped ReadOnlySpan<(string, string?)> attributes)
where TSelf : IHtmlElement<TSelf>, allows ref struct
{
foreach ((string key, string? value) in attributes)
{
WriteKey(element.Writer, key);
WriteValue(element.Writer, value);
}
return element;
}
private static void WriteKey(TextWriter writer, string key)
{
writer.Write(' ');
writer.Write(key);
}
private static void WriteValue(TextWriter writer, string? value)
{
writer.Write("=\"");
writer.Write(value);
writer.Write('"');
}
}
@@ -0,0 +1,38 @@
namespace AssetRipper.Text.Html;
/// <summary>
/// A class for custom HTML elements.
/// </summary>
public readonly ref struct CustomHtmlElement : IHtmlElement<CustomHtmlElement>
{
private readonly TextWriter writer;
private readonly string name;
internal CustomHtmlElement(TextWriter writer, string name)
{
this.writer = writer;
this.name = name;
}
public void Close() => writer.Write("/>");
public HtmlElementCloser End()
{
writer.Write('>');
return new HtmlElementCloser(writer, $"</{name}>");
}
static ReadOnlySpan<string> IHtmlElement<CustomHtmlElement>.SupportedAttributes => [];
static string IHtmlElement<CustomHtmlElement>.Name => throw new NotSupportedException();
static bool IHtmlElement<CustomHtmlElement>.IsVoidElement => false;
TextWriter IHtmlElement<CustomHtmlElement>.Writer => writer;
static CustomHtmlElement IHtmlElement<CustomHtmlElement>.Create(TextWriter writer)
{
throw new NotSupportedException();
}
}
+68 -68
View File
@@ -4,7 +4,17 @@
namespace AssetRipper.Text.Html;
public readonly ref partial struct A
public readonly ref partial struct A : IHtmlElement<A>,
IDownloadAttribute<A>,
IHrefAttribute<A>,
IHrefLangAttribute<A>,
IMediaAttribute<A>,
IPingAttribute<A>,
IReferrerPolicyAttribute<A>,
IRelAttribute<A>,
IShapeAttribute<A>,
ITargetAttribute<A>,
IGlobalAttributes<A>
{
private const string ElementName = "a";
private readonly TextWriter writer;
@@ -15,7 +25,7 @@ public readonly ref partial struct A
writer.Write($"<{ElementName}");
}
public string? Accesskey
public string? AccessKey
{
set
{
@@ -25,9 +35,9 @@ public readonly ref partial struct A
}
}
public A WithAccesskey(string? value = null)
public A WithAccessKey(string? value = null)
{
Accesskey = value;
AccessKey = value;
return this;
}
@@ -63,7 +73,7 @@ public readonly ref partial struct A
return this;
}
public string? Contenteditable
public string? ContentEditable
{
set
{
@@ -73,25 +83,9 @@ public readonly ref partial struct A
}
}
public A WithContenteditable(string? value = null)
public A WithContentEditable(string? value = null)
{
Contenteditable = value;
return this;
}
public string? Contextmenu
{
set
{
writer.Write(" contextmenu=\"");
writer.Write(value);
writer.Write('"');
}
}
public A WithContextmenu(string? value = null)
{
Contextmenu = value;
ContentEditable = value;
return this;
}
@@ -175,7 +169,7 @@ public readonly ref partial struct A
return this;
}
public string? Hreflang
public string? HrefLang
{
set
{
@@ -185,9 +179,9 @@ public readonly ref partial struct A
}
}
public A WithHreflang(string? value = null)
public A WithHrefLang(string? value = null)
{
Hreflang = value;
HrefLang = value;
return this;
}
@@ -207,7 +201,7 @@ public readonly ref partial struct A
return this;
}
public string? Itemprop
public string? ItemProp
{
set
{
@@ -217,9 +211,9 @@ public readonly ref partial struct A
}
}
public A WithItemprop(string? value = null)
public A WithItemProp(string? value = null)
{
Itemprop = value;
ItemProp = value;
return this;
}
@@ -271,7 +265,7 @@ public readonly ref partial struct A
return this;
}
public string? Referrerpolicy
public string? ReferrerPolicy
{
set
{
@@ -281,9 +275,9 @@ public readonly ref partial struct A
}
}
public A WithReferrerpolicy(string? value = null)
public A WithReferrerPolicy(string? value = null)
{
Referrerpolicy = value;
ReferrerPolicy = value;
return this;
}
@@ -351,7 +345,7 @@ public readonly ref partial struct A
return this;
}
public string? Spellcheck
public string? SpellCheck
{
set
{
@@ -361,9 +355,9 @@ public readonly ref partial struct A
}
}
public A WithSpellcheck(string? value = null)
public A WithSpellCheck(string? value = null)
{
Spellcheck = value;
SpellCheck = value;
return this;
}
@@ -383,7 +377,7 @@ public readonly ref partial struct A
return this;
}
public string? Tabindex
public string? TabIndex
{
set
{
@@ -393,9 +387,9 @@ public readonly ref partial struct A
}
}
public A WithTabindex(string? value = null)
public A WithTabIndex(string? value = null)
{
Tabindex = value;
TabIndex = value;
return this;
}
@@ -447,36 +441,6 @@ public readonly ref partial struct A
return this;
}
public A WithCustomAttribute(string key, string? value = null)
{
WriteKey(key);
WriteValue(value);
return this;
}
public A WithCustomAttributes(scoped ReadOnlySpan<(string, string?)> attributes)
{
foreach ((string key, string? value) in attributes)
{
WriteKey(key);
WriteValue(value);
}
return this;
}
private void WriteKey(string key)
{
writer.Write(' ');
writer.Write(key);
}
private void WriteValue(string? value)
{
writer.Write("=\"");
writer.Write(value);
writer.Write('"');
}
public void Close() => writer.Write($"></{ElementName}>");
/// <summary>
@@ -497,4 +461,40 @@ public readonly ref partial struct A
writer.Write('>');
return new HtmlElementCloser(writer, $"</{ElementName}>");
}
// IHtmlElement<TSelf> implementation
TextWriter IHtmlElement<A>.Writer => writer;
static A IHtmlElement<A>.Create(TextWriter writer) => new(writer);
static bool IHtmlElement<A>.IsVoidElement => false;
static string IHtmlElement<A>.Name => ElementName;
static ReadOnlySpan<string> IHtmlElement<A>.SupportedAttributes => _supportedAttributes;
private static readonly string[] _supportedAttributes =
[
"accesskey",
"autocapitalize",
"class",
"contenteditable",
"dir",
"download",
"draggable",
"hidden",
"href",
"hreflang",
"id",
"itemprop",
"lang",
"media",
"ping",
"referrerpolicy",
"rel",
"role",
"shape",
"slot",
"spellcheck",
"style",
"tabindex",
"target",
"title",
"translate",
];
}
+44 -62
View File
@@ -4,7 +4,8 @@
namespace AssetRipper.Text.Html;
public readonly ref partial struct Abbr
public readonly ref partial struct Abbr : IHtmlElement<Abbr>,
IGlobalAttributes<Abbr>
{
private const string ElementName = "abbr";
private readonly TextWriter writer;
@@ -15,7 +16,7 @@ public readonly ref partial struct Abbr
writer.Write($"<{ElementName}");
}
public string? Accesskey
public string? AccessKey
{
set
{
@@ -25,9 +26,9 @@ public readonly ref partial struct Abbr
}
}
public Abbr WithAccesskey(string? value = null)
public Abbr WithAccessKey(string? value = null)
{
Accesskey = value;
AccessKey = value;
return this;
}
@@ -63,7 +64,7 @@ public readonly ref partial struct Abbr
return this;
}
public string? Contenteditable
public string? ContentEditable
{
set
{
@@ -73,25 +74,9 @@ public readonly ref partial struct Abbr
}
}
public Abbr WithContenteditable(string? value = null)
public Abbr WithContentEditable(string? value = null)
{
Contenteditable = value;
return this;
}
public string? Contextmenu
{
set
{
writer.Write(" contextmenu=\"");
writer.Write(value);
writer.Write('"');
}
}
public Abbr WithContextmenu(string? value = null)
{
Contextmenu = value;
ContentEditable = value;
return this;
}
@@ -159,7 +144,7 @@ public readonly ref partial struct Abbr
return this;
}
public string? Itemprop
public string? ItemProp
{
set
{
@@ -169,9 +154,9 @@ public readonly ref partial struct Abbr
}
}
public Abbr WithItemprop(string? value = null)
public Abbr WithItemProp(string? value = null)
{
Itemprop = value;
ItemProp = value;
return this;
}
@@ -223,7 +208,7 @@ public readonly ref partial struct Abbr
return this;
}
public string? Spellcheck
public string? SpellCheck
{
set
{
@@ -233,9 +218,9 @@ public readonly ref partial struct Abbr
}
}
public Abbr WithSpellcheck(string? value = null)
public Abbr WithSpellCheck(string? value = null)
{
Spellcheck = value;
SpellCheck = value;
return this;
}
@@ -255,7 +240,7 @@ public readonly ref partial struct Abbr
return this;
}
public string? Tabindex
public string? TabIndex
{
set
{
@@ -265,9 +250,9 @@ public readonly ref partial struct Abbr
}
}
public Abbr WithTabindex(string? value = null)
public Abbr WithTabIndex(string? value = null)
{
Tabindex = value;
TabIndex = value;
return this;
}
@@ -303,36 +288,6 @@ public readonly ref partial struct Abbr
return this;
}
public Abbr WithCustomAttribute(string key, string? value = null)
{
WriteKey(key);
WriteValue(value);
return this;
}
public Abbr WithCustomAttributes(scoped ReadOnlySpan<(string, string?)> attributes)
{
foreach ((string key, string? value) in attributes)
{
WriteKey(key);
WriteValue(value);
}
return this;
}
private void WriteKey(string key)
{
writer.Write(' ');
writer.Write(key);
}
private void WriteValue(string? value)
{
writer.Write("=\"");
writer.Write(value);
writer.Write('"');
}
public void Close() => writer.Write($"></{ElementName}>");
/// <summary>
@@ -353,4 +308,31 @@ public readonly ref partial struct Abbr
writer.Write('>');
return new HtmlElementCloser(writer, $"</{ElementName}>");
}
// IHtmlElement<TSelf> implementation
TextWriter IHtmlElement<Abbr>.Writer => writer;
static Abbr IHtmlElement<Abbr>.Create(TextWriter writer) => new(writer);
static bool IHtmlElement<Abbr>.IsVoidElement => false;
static string IHtmlElement<Abbr>.Name => ElementName;
static ReadOnlySpan<string> IHtmlElement<Abbr>.SupportedAttributes => _supportedAttributes;
private static readonly string[] _supportedAttributes =
[
"accesskey",
"autocapitalize",
"class",
"contenteditable",
"dir",
"draggable",
"hidden",
"id",
"itemprop",
"lang",
"role",
"slot",
"spellcheck",
"style",
"tabindex",
"title",
"translate",
];
}
+44 -62
View File
@@ -4,7 +4,8 @@
namespace AssetRipper.Text.Html;
public readonly ref partial struct Acronym
public readonly ref partial struct Acronym : IHtmlElement<Acronym>,
IGlobalAttributes<Acronym>
{
private const string ElementName = "acronym";
private readonly TextWriter writer;
@@ -15,7 +16,7 @@ public readonly ref partial struct Acronym
writer.Write($"<{ElementName}");
}
public string? Accesskey
public string? AccessKey
{
set
{
@@ -25,9 +26,9 @@ public readonly ref partial struct Acronym
}
}
public Acronym WithAccesskey(string? value = null)
public Acronym WithAccessKey(string? value = null)
{
Accesskey = value;
AccessKey = value;
return this;
}
@@ -63,7 +64,7 @@ public readonly ref partial struct Acronym
return this;
}
public string? Contenteditable
public string? ContentEditable
{
set
{
@@ -73,25 +74,9 @@ public readonly ref partial struct Acronym
}
}
public Acronym WithContenteditable(string? value = null)
public Acronym WithContentEditable(string? value = null)
{
Contenteditable = value;
return this;
}
public string? Contextmenu
{
set
{
writer.Write(" contextmenu=\"");
writer.Write(value);
writer.Write('"');
}
}
public Acronym WithContextmenu(string? value = null)
{
Contextmenu = value;
ContentEditable = value;
return this;
}
@@ -159,7 +144,7 @@ public readonly ref partial struct Acronym
return this;
}
public string? Itemprop
public string? ItemProp
{
set
{
@@ -169,9 +154,9 @@ public readonly ref partial struct Acronym
}
}
public Acronym WithItemprop(string? value = null)
public Acronym WithItemProp(string? value = null)
{
Itemprop = value;
ItemProp = value;
return this;
}
@@ -223,7 +208,7 @@ public readonly ref partial struct Acronym
return this;
}
public string? Spellcheck
public string? SpellCheck
{
set
{
@@ -233,9 +218,9 @@ public readonly ref partial struct Acronym
}
}
public Acronym WithSpellcheck(string? value = null)
public Acronym WithSpellCheck(string? value = null)
{
Spellcheck = value;
SpellCheck = value;
return this;
}
@@ -255,7 +240,7 @@ public readonly ref partial struct Acronym
return this;
}
public string? Tabindex
public string? TabIndex
{
set
{
@@ -265,9 +250,9 @@ public readonly ref partial struct Acronym
}
}
public Acronym WithTabindex(string? value = null)
public Acronym WithTabIndex(string? value = null)
{
Tabindex = value;
TabIndex = value;
return this;
}
@@ -303,36 +288,6 @@ public readonly ref partial struct Acronym
return this;
}
public Acronym WithCustomAttribute(string key, string? value = null)
{
WriteKey(key);
WriteValue(value);
return this;
}
public Acronym WithCustomAttributes(scoped ReadOnlySpan<(string, string?)> attributes)
{
foreach ((string key, string? value) in attributes)
{
WriteKey(key);
WriteValue(value);
}
return this;
}
private void WriteKey(string key)
{
writer.Write(' ');
writer.Write(key);
}
private void WriteValue(string? value)
{
writer.Write("=\"");
writer.Write(value);
writer.Write('"');
}
public void Close() => writer.Write($"></{ElementName}>");
/// <summary>
@@ -353,4 +308,31 @@ public readonly ref partial struct Acronym
writer.Write('>');
return new HtmlElementCloser(writer, $"</{ElementName}>");
}
// IHtmlElement<TSelf> implementation
TextWriter IHtmlElement<Acronym>.Writer => writer;
static Acronym IHtmlElement<Acronym>.Create(TextWriter writer) => new(writer);
static bool IHtmlElement<Acronym>.IsVoidElement => false;
static string IHtmlElement<Acronym>.Name => ElementName;
static ReadOnlySpan<string> IHtmlElement<Acronym>.SupportedAttributes => _supportedAttributes;
private static readonly string[] _supportedAttributes =
[
"accesskey",
"autocapitalize",
"class",
"contenteditable",
"dir",
"draggable",
"hidden",
"id",
"itemprop",
"lang",
"role",
"slot",
"spellcheck",
"style",
"tabindex",
"title",
"translate",
];
}
+44 -62
View File
@@ -4,7 +4,8 @@
namespace AssetRipper.Text.Html;
public readonly ref partial struct Address
public readonly ref partial struct Address : IHtmlElement<Address>,
IGlobalAttributes<Address>
{
private const string ElementName = "address";
private readonly TextWriter writer;
@@ -15,7 +16,7 @@ public readonly ref partial struct Address
writer.Write($"<{ElementName}");
}
public string? Accesskey
public string? AccessKey
{
set
{
@@ -25,9 +26,9 @@ public readonly ref partial struct Address
}
}
public Address WithAccesskey(string? value = null)
public Address WithAccessKey(string? value = null)
{
Accesskey = value;
AccessKey = value;
return this;
}
@@ -63,7 +64,7 @@ public readonly ref partial struct Address
return this;
}
public string? Contenteditable
public string? ContentEditable
{
set
{
@@ -73,25 +74,9 @@ public readonly ref partial struct Address
}
}
public Address WithContenteditable(string? value = null)
public Address WithContentEditable(string? value = null)
{
Contenteditable = value;
return this;
}
public string? Contextmenu
{
set
{
writer.Write(" contextmenu=\"");
writer.Write(value);
writer.Write('"');
}
}
public Address WithContextmenu(string? value = null)
{
Contextmenu = value;
ContentEditable = value;
return this;
}
@@ -159,7 +144,7 @@ public readonly ref partial struct Address
return this;
}
public string? Itemprop
public string? ItemProp
{
set
{
@@ -169,9 +154,9 @@ public readonly ref partial struct Address
}
}
public Address WithItemprop(string? value = null)
public Address WithItemProp(string? value = null)
{
Itemprop = value;
ItemProp = value;
return this;
}
@@ -223,7 +208,7 @@ public readonly ref partial struct Address
return this;
}
public string? Spellcheck
public string? SpellCheck
{
set
{
@@ -233,9 +218,9 @@ public readonly ref partial struct Address
}
}
public Address WithSpellcheck(string? value = null)
public Address WithSpellCheck(string? value = null)
{
Spellcheck = value;
SpellCheck = value;
return this;
}
@@ -255,7 +240,7 @@ public readonly ref partial struct Address
return this;
}
public string? Tabindex
public string? TabIndex
{
set
{
@@ -265,9 +250,9 @@ public readonly ref partial struct Address
}
}
public Address WithTabindex(string? value = null)
public Address WithTabIndex(string? value = null)
{
Tabindex = value;
TabIndex = value;
return this;
}
@@ -303,36 +288,6 @@ public readonly ref partial struct Address
return this;
}
public Address WithCustomAttribute(string key, string? value = null)
{
WriteKey(key);
WriteValue(value);
return this;
}
public Address WithCustomAttributes(scoped ReadOnlySpan<(string, string?)> attributes)
{
foreach ((string key, string? value) in attributes)
{
WriteKey(key);
WriteValue(value);
}
return this;
}
private void WriteKey(string key)
{
writer.Write(' ');
writer.Write(key);
}
private void WriteValue(string? value)
{
writer.Write("=\"");
writer.Write(value);
writer.Write('"');
}
public void Close() => writer.Write($"></{ElementName}>");
/// <summary>
@@ -353,4 +308,31 @@ public readonly ref partial struct Address
writer.Write('>');
return new HtmlElementCloser(writer, $"</{ElementName}>");
}
// IHtmlElement<TSelf> implementation
TextWriter IHtmlElement<Address>.Writer => writer;
static Address IHtmlElement<Address>.Create(TextWriter writer) => new(writer);
static bool IHtmlElement<Address>.IsVoidElement => false;
static string IHtmlElement<Address>.Name => ElementName;
static ReadOnlySpan<string> IHtmlElement<Address>.SupportedAttributes => _supportedAttributes;
private static readonly string[] _supportedAttributes =
[
"accesskey",
"autocapitalize",
"class",
"contenteditable",
"dir",
"draggable",
"hidden",
"id",
"itemprop",
"lang",
"role",
"slot",
"spellcheck",
"style",
"tabindex",
"title",
"translate",
];
}
+69 -65
View File
@@ -4,7 +4,18 @@
namespace AssetRipper.Text.Html;
public readonly ref partial struct Area
public readonly ref partial struct Area : IHtmlElement<Area>,
IAltAttribute<Area>,
ICoordsAttribute<Area>,
IDownloadAttribute<Area>,
IHrefAttribute<Area>,
IMediaAttribute<Area>,
IPingAttribute<Area>,
IReferrerPolicyAttribute<Area>,
IRelAttribute<Area>,
IShapeAttribute<Area>,
ITargetAttribute<Area>,
IGlobalAttributes<Area>
{
private const string ElementName = "area";
private readonly TextWriter writer;
@@ -15,7 +26,7 @@ public readonly ref partial struct Area
writer.Write($"<{ElementName}");
}
public string? Accesskey
public string? AccessKey
{
set
{
@@ -25,9 +36,9 @@ public readonly ref partial struct Area
}
}
public Area WithAccesskey(string? value = null)
public Area WithAccessKey(string? value = null)
{
Accesskey = value;
AccessKey = value;
return this;
}
@@ -79,7 +90,7 @@ public readonly ref partial struct Area
return this;
}
public string? Contenteditable
public string? ContentEditable
{
set
{
@@ -89,25 +100,9 @@ public readonly ref partial struct Area
}
}
public Area WithContenteditable(string? value = null)
public Area WithContentEditable(string? value = null)
{
Contenteditable = value;
return this;
}
public string? Contextmenu
{
set
{
writer.Write(" contextmenu=\"");
writer.Write(value);
writer.Write('"');
}
}
public Area WithContextmenu(string? value = null)
{
Contextmenu = value;
ContentEditable = value;
return this;
}
@@ -223,7 +218,7 @@ public readonly ref partial struct Area
return this;
}
public string? Itemprop
public string? ItemProp
{
set
{
@@ -233,9 +228,9 @@ public readonly ref partial struct Area
}
}
public Area WithItemprop(string? value = null)
public Area WithItemProp(string? value = null)
{
Itemprop = value;
ItemProp = value;
return this;
}
@@ -287,7 +282,7 @@ public readonly ref partial struct Area
return this;
}
public string? Referrerpolicy
public string? ReferrerPolicy
{
set
{
@@ -297,9 +292,9 @@ public readonly ref partial struct Area
}
}
public Area WithReferrerpolicy(string? value = null)
public Area WithReferrerPolicy(string? value = null)
{
Referrerpolicy = value;
ReferrerPolicy = value;
return this;
}
@@ -367,7 +362,7 @@ public readonly ref partial struct Area
return this;
}
public string? Spellcheck
public string? SpellCheck
{
set
{
@@ -377,9 +372,9 @@ public readonly ref partial struct Area
}
}
public Area WithSpellcheck(string? value = null)
public Area WithSpellCheck(string? value = null)
{
Spellcheck = value;
SpellCheck = value;
return this;
}
@@ -399,7 +394,7 @@ public readonly ref partial struct Area
return this;
}
public string? Tabindex
public string? TabIndex
{
set
{
@@ -409,9 +404,9 @@ public readonly ref partial struct Area
}
}
public Area WithTabindex(string? value = null)
public Area WithTabIndex(string? value = null)
{
Tabindex = value;
TabIndex = value;
return this;
}
@@ -463,35 +458,44 @@ public readonly ref partial struct Area
return this;
}
public Area WithCustomAttribute(string key, string? value = null)
{
WriteKey(key);
WriteValue(value);
return this;
}
public Area WithCustomAttributes(scoped ReadOnlySpan<(string, string?)> attributes)
{
foreach ((string key, string? value) in attributes)
{
WriteKey(key);
WriteValue(value);
}
return this;
}
private void WriteKey(string key)
{
writer.Write(' ');
writer.Write(key);
}
private void WriteValue(string? value)
{
writer.Write("=\"");
writer.Write(value);
writer.Write('"');
}
public void Close() => writer.Write("/>");
HtmlElementCloser IHtmlElement<Area>.End() => throw new NotSupportedException();
// IHtmlElement<TSelf> implementation
TextWriter IHtmlElement<Area>.Writer => writer;
static Area IHtmlElement<Area>.Create(TextWriter writer) => new(writer);
static bool IHtmlElement<Area>.IsVoidElement => true;
static string IHtmlElement<Area>.Name => ElementName;
static ReadOnlySpan<string> IHtmlElement<Area>.SupportedAttributes => _supportedAttributes;
private static readonly string[] _supportedAttributes =
[
"accesskey",
"alt",
"autocapitalize",
"class",
"contenteditable",
"coords",
"dir",
"download",
"draggable",
"hidden",
"href",
"id",
"itemprop",
"lang",
"media",
"ping",
"referrerpolicy",
"rel",
"role",
"shape",
"slot",
"spellcheck",
"style",
"tabindex",
"target",
"title",
"translate",
];
}
+44 -62
View File
@@ -4,7 +4,8 @@
namespace AssetRipper.Text.Html;
public readonly ref partial struct Article
public readonly ref partial struct Article : IHtmlElement<Article>,
IGlobalAttributes<Article>
{
private const string ElementName = "article";
private readonly TextWriter writer;
@@ -15,7 +16,7 @@ public readonly ref partial struct Article
writer.Write($"<{ElementName}");
}
public string? Accesskey
public string? AccessKey
{
set
{
@@ -25,9 +26,9 @@ public readonly ref partial struct Article
}
}
public Article WithAccesskey(string? value = null)
public Article WithAccessKey(string? value = null)
{
Accesskey = value;
AccessKey = value;
return this;
}
@@ -63,7 +64,7 @@ public readonly ref partial struct Article
return this;
}
public string? Contenteditable
public string? ContentEditable
{
set
{
@@ -73,25 +74,9 @@ public readonly ref partial struct Article
}
}
public Article WithContenteditable(string? value = null)
public Article WithContentEditable(string? value = null)
{
Contenteditable = value;
return this;
}
public string? Contextmenu
{
set
{
writer.Write(" contextmenu=\"");
writer.Write(value);
writer.Write('"');
}
}
public Article WithContextmenu(string? value = null)
{
Contextmenu = value;
ContentEditable = value;
return this;
}
@@ -159,7 +144,7 @@ public readonly ref partial struct Article
return this;
}
public string? Itemprop
public string? ItemProp
{
set
{
@@ -169,9 +154,9 @@ public readonly ref partial struct Article
}
}
public Article WithItemprop(string? value = null)
public Article WithItemProp(string? value = null)
{
Itemprop = value;
ItemProp = value;
return this;
}
@@ -223,7 +208,7 @@ public readonly ref partial struct Article
return this;
}
public string? Spellcheck
public string? SpellCheck
{
set
{
@@ -233,9 +218,9 @@ public readonly ref partial struct Article
}
}
public Article WithSpellcheck(string? value = null)
public Article WithSpellCheck(string? value = null)
{
Spellcheck = value;
SpellCheck = value;
return this;
}
@@ -255,7 +240,7 @@ public readonly ref partial struct Article
return this;
}
public string? Tabindex
public string? TabIndex
{
set
{
@@ -265,9 +250,9 @@ public readonly ref partial struct Article
}
}
public Article WithTabindex(string? value = null)
public Article WithTabIndex(string? value = null)
{
Tabindex = value;
TabIndex = value;
return this;
}
@@ -303,36 +288,6 @@ public readonly ref partial struct Article
return this;
}
public Article WithCustomAttribute(string key, string? value = null)
{
WriteKey(key);
WriteValue(value);
return this;
}
public Article WithCustomAttributes(scoped ReadOnlySpan<(string, string?)> attributes)
{
foreach ((string key, string? value) in attributes)
{
WriteKey(key);
WriteValue(value);
}
return this;
}
private void WriteKey(string key)
{
writer.Write(' ');
writer.Write(key);
}
private void WriteValue(string? value)
{
writer.Write("=\"");
writer.Write(value);
writer.Write('"');
}
public void Close() => writer.Write($"></{ElementName}>");
/// <summary>
@@ -353,4 +308,31 @@ public readonly ref partial struct Article
writer.Write('>');
return new HtmlElementCloser(writer, $"</{ElementName}>");
}
// IHtmlElement<TSelf> implementation
TextWriter IHtmlElement<Article>.Writer => writer;
static Article IHtmlElement<Article>.Create(TextWriter writer) => new(writer);
static bool IHtmlElement<Article>.IsVoidElement => false;
static string IHtmlElement<Article>.Name => ElementName;
static ReadOnlySpan<string> IHtmlElement<Article>.SupportedAttributes => _supportedAttributes;
private static readonly string[] _supportedAttributes =
[
"accesskey",
"autocapitalize",
"class",
"contenteditable",
"dir",
"draggable",
"hidden",
"id",
"itemprop",
"lang",
"role",
"slot",
"spellcheck",
"style",
"tabindex",
"title",
"translate",
];
}
+44 -62
View File
@@ -4,7 +4,8 @@
namespace AssetRipper.Text.Html;
public readonly ref partial struct Aside
public readonly ref partial struct Aside : IHtmlElement<Aside>,
IGlobalAttributes<Aside>
{
private const string ElementName = "aside";
private readonly TextWriter writer;
@@ -15,7 +16,7 @@ public readonly ref partial struct Aside
writer.Write($"<{ElementName}");
}
public string? Accesskey
public string? AccessKey
{
set
{
@@ -25,9 +26,9 @@ public readonly ref partial struct Aside
}
}
public Aside WithAccesskey(string? value = null)
public Aside WithAccessKey(string? value = null)
{
Accesskey = value;
AccessKey = value;
return this;
}
@@ -63,7 +64,7 @@ public readonly ref partial struct Aside
return this;
}
public string? Contenteditable
public string? ContentEditable
{
set
{
@@ -73,25 +74,9 @@ public readonly ref partial struct Aside
}
}
public Aside WithContenteditable(string? value = null)
public Aside WithContentEditable(string? value = null)
{
Contenteditable = value;
return this;
}
public string? Contextmenu
{
set
{
writer.Write(" contextmenu=\"");
writer.Write(value);
writer.Write('"');
}
}
public Aside WithContextmenu(string? value = null)
{
Contextmenu = value;
ContentEditable = value;
return this;
}
@@ -159,7 +144,7 @@ public readonly ref partial struct Aside
return this;
}
public string? Itemprop
public string? ItemProp
{
set
{
@@ -169,9 +154,9 @@ public readonly ref partial struct Aside
}
}
public Aside WithItemprop(string? value = null)
public Aside WithItemProp(string? value = null)
{
Itemprop = value;
ItemProp = value;
return this;
}
@@ -223,7 +208,7 @@ public readonly ref partial struct Aside
return this;
}
public string? Spellcheck
public string? SpellCheck
{
set
{
@@ -233,9 +218,9 @@ public readonly ref partial struct Aside
}
}
public Aside WithSpellcheck(string? value = null)
public Aside WithSpellCheck(string? value = null)
{
Spellcheck = value;
SpellCheck = value;
return this;
}
@@ -255,7 +240,7 @@ public readonly ref partial struct Aside
return this;
}
public string? Tabindex
public string? TabIndex
{
set
{
@@ -265,9 +250,9 @@ public readonly ref partial struct Aside
}
}
public Aside WithTabindex(string? value = null)
public Aside WithTabIndex(string? value = null)
{
Tabindex = value;
TabIndex = value;
return this;
}
@@ -303,36 +288,6 @@ public readonly ref partial struct Aside
return this;
}
public Aside WithCustomAttribute(string key, string? value = null)
{
WriteKey(key);
WriteValue(value);
return this;
}
public Aside WithCustomAttributes(scoped ReadOnlySpan<(string, string?)> attributes)
{
foreach ((string key, string? value) in attributes)
{
WriteKey(key);
WriteValue(value);
}
return this;
}
private void WriteKey(string key)
{
writer.Write(' ');
writer.Write(key);
}
private void WriteValue(string? value)
{
writer.Write("=\"");
writer.Write(value);
writer.Write('"');
}
public void Close() => writer.Write($"></{ElementName}>");
/// <summary>
@@ -353,4 +308,31 @@ public readonly ref partial struct Aside
writer.Write('>');
return new HtmlElementCloser(writer, $"</{ElementName}>");
}
// IHtmlElement<TSelf> implementation
TextWriter IHtmlElement<Aside>.Writer => writer;
static Aside IHtmlElement<Aside>.Create(TextWriter writer) => new(writer);
static bool IHtmlElement<Aside>.IsVoidElement => false;
static string IHtmlElement<Aside>.Name => ElementName;
static ReadOnlySpan<string> IHtmlElement<Aside>.SupportedAttributes => _supportedAttributes;
private static readonly string[] _supportedAttributes =
[
"accesskey",
"autocapitalize",
"class",
"contenteditable",
"dir",
"draggable",
"hidden",
"id",
"itemprop",
"lang",
"role",
"slot",
"spellcheck",
"style",
"tabindex",
"title",
"translate",
];
}
+61 -81
View File
@@ -4,7 +4,15 @@
namespace AssetRipper.Text.Html;
public readonly ref partial struct Audio
public readonly ref partial struct Audio : IHtmlElement<Audio>,
IAutoplayAttribute<Audio>,
IControlsAttribute<Audio>,
ICrossOriginAttribute<Audio>,
ILoopAttribute<Audio>,
IMutedAttribute<Audio>,
IPreloadAttribute<Audio>,
ISrcAttribute<Audio>,
IGlobalAttributes<Audio>
{
private const string ElementName = "audio";
private readonly TextWriter writer;
@@ -15,7 +23,7 @@ public readonly ref partial struct Audio
writer.Write($"<{ElementName}");
}
public string? Accesskey
public string? AccessKey
{
set
{
@@ -25,9 +33,9 @@ public readonly ref partial struct Audio
}
}
public Audio WithAccesskey(string? value = null)
public Audio WithAccessKey(string? value = null)
{
Accesskey = value;
AccessKey = value;
return this;
}
@@ -63,22 +71,6 @@ public readonly ref partial struct Audio
return this;
}
public string? Buffered
{
set
{
writer.Write(" buffered=\"");
writer.Write(value);
writer.Write('"');
}
}
public Audio WithBuffered(string? value = null)
{
Buffered = value;
return this;
}
public string? Class
{
set
@@ -95,7 +87,7 @@ public readonly ref partial struct Audio
return this;
}
public string? Contenteditable
public string? ContentEditable
{
set
{
@@ -105,25 +97,9 @@ public readonly ref partial struct Audio
}
}
public Audio WithContenteditable(string? value = null)
public Audio WithContentEditable(string? value = null)
{
Contenteditable = value;
return this;
}
public string? Contextmenu
{
set
{
writer.Write(" contextmenu=\"");
writer.Write(value);
writer.Write('"');
}
}
public Audio WithContextmenu(string? value = null)
{
Contextmenu = value;
ContentEditable = value;
return this;
}
@@ -143,7 +119,7 @@ public readonly ref partial struct Audio
return this;
}
public string? Crossorigin
public string? CrossOrigin
{
set
{
@@ -153,9 +129,9 @@ public readonly ref partial struct Audio
}
}
public Audio WithCrossorigin(string? value = null)
public Audio WithCrossOrigin(string? value = null)
{
Crossorigin = value;
CrossOrigin = value;
return this;
}
@@ -223,7 +199,7 @@ public readonly ref partial struct Audio
return this;
}
public string? Itemprop
public string? ItemProp
{
set
{
@@ -233,9 +209,9 @@ public readonly ref partial struct Audio
}
}
public Audio WithItemprop(string? value = null)
public Audio WithItemProp(string? value = null)
{
Itemprop = value;
ItemProp = value;
return this;
}
@@ -335,7 +311,7 @@ public readonly ref partial struct Audio
return this;
}
public string? Spellcheck
public string? SpellCheck
{
set
{
@@ -345,9 +321,9 @@ public readonly ref partial struct Audio
}
}
public Audio WithSpellcheck(string? value = null)
public Audio WithSpellCheck(string? value = null)
{
Spellcheck = value;
SpellCheck = value;
return this;
}
@@ -383,7 +359,7 @@ public readonly ref partial struct Audio
return this;
}
public string? Tabindex
public string? TabIndex
{
set
{
@@ -393,9 +369,9 @@ public readonly ref partial struct Audio
}
}
public Audio WithTabindex(string? value = null)
public Audio WithTabIndex(string? value = null)
{
Tabindex = value;
TabIndex = value;
return this;
}
@@ -431,36 +407,6 @@ public readonly ref partial struct Audio
return this;
}
public Audio WithCustomAttribute(string key, string? value = null)
{
WriteKey(key);
WriteValue(value);
return this;
}
public Audio WithCustomAttributes(scoped ReadOnlySpan<(string, string?)> attributes)
{
foreach ((string key, string? value) in attributes)
{
WriteKey(key);
WriteValue(value);
}
return this;
}
private void WriteKey(string key)
{
writer.Write(' ');
writer.Write(key);
}
private void WriteValue(string? value)
{
writer.Write("=\"");
writer.Write(value);
writer.Write('"');
}
public void Close() => writer.Write($"></{ElementName}>");
/// <summary>
@@ -481,4 +427,38 @@ public readonly ref partial struct Audio
writer.Write('>');
return new HtmlElementCloser(writer, $"</{ElementName}>");
}
// IHtmlElement<TSelf> implementation
TextWriter IHtmlElement<Audio>.Writer => writer;
static Audio IHtmlElement<Audio>.Create(TextWriter writer) => new(writer);
static bool IHtmlElement<Audio>.IsVoidElement => false;
static string IHtmlElement<Audio>.Name => ElementName;
static ReadOnlySpan<string> IHtmlElement<Audio>.SupportedAttributes => _supportedAttributes;
private static readonly string[] _supportedAttributes =
[
"accesskey",
"autocapitalize",
"autoplay",
"class",
"contenteditable",
"controls",
"crossorigin",
"dir",
"draggable",
"hidden",
"id",
"itemprop",
"lang",
"loop",
"muted",
"preload",
"role",
"slot",
"spellcheck",
"src",
"style",
"tabindex",
"title",
"translate",
];
}
+44 -62
View File
@@ -4,7 +4,8 @@
namespace AssetRipper.Text.Html;
public readonly ref partial struct B
public readonly ref partial struct B : IHtmlElement<B>,
IGlobalAttributes<B>
{
private const string ElementName = "b";
private readonly TextWriter writer;
@@ -15,7 +16,7 @@ public readonly ref partial struct B
writer.Write($"<{ElementName}");
}
public string? Accesskey
public string? AccessKey
{
set
{
@@ -25,9 +26,9 @@ public readonly ref partial struct B
}
}
public B WithAccesskey(string? value = null)
public B WithAccessKey(string? value = null)
{
Accesskey = value;
AccessKey = value;
return this;
}
@@ -63,7 +64,7 @@ public readonly ref partial struct B
return this;
}
public string? Contenteditable
public string? ContentEditable
{
set
{
@@ -73,25 +74,9 @@ public readonly ref partial struct B
}
}
public B WithContenteditable(string? value = null)
public B WithContentEditable(string? value = null)
{
Contenteditable = value;
return this;
}
public string? Contextmenu
{
set
{
writer.Write(" contextmenu=\"");
writer.Write(value);
writer.Write('"');
}
}
public B WithContextmenu(string? value = null)
{
Contextmenu = value;
ContentEditable = value;
return this;
}
@@ -159,7 +144,7 @@ public readonly ref partial struct B
return this;
}
public string? Itemprop
public string? ItemProp
{
set
{
@@ -169,9 +154,9 @@ public readonly ref partial struct B
}
}
public B WithItemprop(string? value = null)
public B WithItemProp(string? value = null)
{
Itemprop = value;
ItemProp = value;
return this;
}
@@ -223,7 +208,7 @@ public readonly ref partial struct B
return this;
}
public string? Spellcheck
public string? SpellCheck
{
set
{
@@ -233,9 +218,9 @@ public readonly ref partial struct B
}
}
public B WithSpellcheck(string? value = null)
public B WithSpellCheck(string? value = null)
{
Spellcheck = value;
SpellCheck = value;
return this;
}
@@ -255,7 +240,7 @@ public readonly ref partial struct B
return this;
}
public string? Tabindex
public string? TabIndex
{
set
{
@@ -265,9 +250,9 @@ public readonly ref partial struct B
}
}
public B WithTabindex(string? value = null)
public B WithTabIndex(string? value = null)
{
Tabindex = value;
TabIndex = value;
return this;
}
@@ -303,36 +288,6 @@ public readonly ref partial struct B
return this;
}
public B WithCustomAttribute(string key, string? value = null)
{
WriteKey(key);
WriteValue(value);
return this;
}
public B WithCustomAttributes(scoped ReadOnlySpan<(string, string?)> attributes)
{
foreach ((string key, string? value) in attributes)
{
WriteKey(key);
WriteValue(value);
}
return this;
}
private void WriteKey(string key)
{
writer.Write(' ');
writer.Write(key);
}
private void WriteValue(string? value)
{
writer.Write("=\"");
writer.Write(value);
writer.Write('"');
}
public void Close() => writer.Write($"></{ElementName}>");
/// <summary>
@@ -353,4 +308,31 @@ public readonly ref partial struct B
writer.Write('>');
return new HtmlElementCloser(writer, $"</{ElementName}>");
}
// IHtmlElement<TSelf> implementation
TextWriter IHtmlElement<B>.Writer => writer;
static B IHtmlElement<B>.Create(TextWriter writer) => new(writer);
static bool IHtmlElement<B>.IsVoidElement => false;
static string IHtmlElement<B>.Name => ElementName;
static ReadOnlySpan<string> IHtmlElement<B>.SupportedAttributes => _supportedAttributes;
private static readonly string[] _supportedAttributes =
[
"accesskey",
"autocapitalize",
"class",
"contenteditable",
"dir",
"draggable",
"hidden",
"id",
"itemprop",
"lang",
"role",
"slot",
"spellcheck",
"style",
"tabindex",
"title",
"translate",
];
}
+50 -62
View File
@@ -4,7 +4,10 @@
namespace AssetRipper.Text.Html;
public readonly ref partial struct Base
public readonly ref partial struct Base : IHtmlElement<Base>,
IHrefAttribute<Base>,
ITargetAttribute<Base>,
IGlobalAttributes<Base>
{
private const string ElementName = "base";
private readonly TextWriter writer;
@@ -15,7 +18,7 @@ public readonly ref partial struct Base
writer.Write($"<{ElementName}");
}
public string? Accesskey
public string? AccessKey
{
set
{
@@ -25,9 +28,9 @@ public readonly ref partial struct Base
}
}
public Base WithAccesskey(string? value = null)
public Base WithAccessKey(string? value = null)
{
Accesskey = value;
AccessKey = value;
return this;
}
@@ -63,7 +66,7 @@ public readonly ref partial struct Base
return this;
}
public string? Contenteditable
public string? ContentEditable
{
set
{
@@ -73,25 +76,9 @@ public readonly ref partial struct Base
}
}
public Base WithContenteditable(string? value = null)
public Base WithContentEditable(string? value = null)
{
Contenteditable = value;
return this;
}
public string? Contextmenu
{
set
{
writer.Write(" contextmenu=\"");
writer.Write(value);
writer.Write('"');
}
}
public Base WithContextmenu(string? value = null)
{
Contextmenu = value;
ContentEditable = value;
return this;
}
@@ -175,7 +162,7 @@ public readonly ref partial struct Base
return this;
}
public string? Itemprop
public string? ItemProp
{
set
{
@@ -185,9 +172,9 @@ public readonly ref partial struct Base
}
}
public Base WithItemprop(string? value = null)
public Base WithItemProp(string? value = null)
{
Itemprop = value;
ItemProp = value;
return this;
}
@@ -239,7 +226,7 @@ public readonly ref partial struct Base
return this;
}
public string? Spellcheck
public string? SpellCheck
{
set
{
@@ -249,9 +236,9 @@ public readonly ref partial struct Base
}
}
public Base WithSpellcheck(string? value = null)
public Base WithSpellCheck(string? value = null)
{
Spellcheck = value;
SpellCheck = value;
return this;
}
@@ -271,7 +258,7 @@ public readonly ref partial struct Base
return this;
}
public string? Tabindex
public string? TabIndex
{
set
{
@@ -281,9 +268,9 @@ public readonly ref partial struct Base
}
}
public Base WithTabindex(string? value = null)
public Base WithTabIndex(string? value = null)
{
Tabindex = value;
TabIndex = value;
return this;
}
@@ -335,35 +322,36 @@ public readonly ref partial struct Base
return this;
}
public Base WithCustomAttribute(string key, string? value = null)
{
WriteKey(key);
WriteValue(value);
return this;
}
public Base WithCustomAttributes(scoped ReadOnlySpan<(string, string?)> attributes)
{
foreach ((string key, string? value) in attributes)
{
WriteKey(key);
WriteValue(value);
}
return this;
}
private void WriteKey(string key)
{
writer.Write(' ');
writer.Write(key);
}
private void WriteValue(string? value)
{
writer.Write("=\"");
writer.Write(value);
writer.Write('"');
}
public void Close() => writer.Write("/>");
HtmlElementCloser IHtmlElement<Base>.End() => throw new NotSupportedException();
// IHtmlElement<TSelf> implementation
TextWriter IHtmlElement<Base>.Writer => writer;
static Base IHtmlElement<Base>.Create(TextWriter writer) => new(writer);
static bool IHtmlElement<Base>.IsVoidElement => true;
static string IHtmlElement<Base>.Name => ElementName;
static ReadOnlySpan<string> IHtmlElement<Base>.SupportedAttributes => _supportedAttributes;
private static readonly string[] _supportedAttributes =
[
"accesskey",
"autocapitalize",
"class",
"contenteditable",
"dir",
"draggable",
"hidden",
"href",
"id",
"itemprop",
"lang",
"role",
"slot",
"spellcheck",
"style",
"tabindex",
"target",
"title",
"translate",
];
}
+44 -62
View File
@@ -4,7 +4,8 @@
namespace AssetRipper.Text.Html;
public readonly ref partial struct Bdi
public readonly ref partial struct Bdi : IHtmlElement<Bdi>,
IGlobalAttributes<Bdi>
{
private const string ElementName = "bdi";
private readonly TextWriter writer;
@@ -15,7 +16,7 @@ public readonly ref partial struct Bdi
writer.Write($"<{ElementName}");
}
public string? Accesskey
public string? AccessKey
{
set
{
@@ -25,9 +26,9 @@ public readonly ref partial struct Bdi
}
}
public Bdi WithAccesskey(string? value = null)
public Bdi WithAccessKey(string? value = null)
{
Accesskey = value;
AccessKey = value;
return this;
}
@@ -63,7 +64,7 @@ public readonly ref partial struct Bdi
return this;
}
public string? Contenteditable
public string? ContentEditable
{
set
{
@@ -73,25 +74,9 @@ public readonly ref partial struct Bdi
}
}
public Bdi WithContenteditable(string? value = null)
public Bdi WithContentEditable(string? value = null)
{
Contenteditable = value;
return this;
}
public string? Contextmenu
{
set
{
writer.Write(" contextmenu=\"");
writer.Write(value);
writer.Write('"');
}
}
public Bdi WithContextmenu(string? value = null)
{
Contextmenu = value;
ContentEditable = value;
return this;
}
@@ -159,7 +144,7 @@ public readonly ref partial struct Bdi
return this;
}
public string? Itemprop
public string? ItemProp
{
set
{
@@ -169,9 +154,9 @@ public readonly ref partial struct Bdi
}
}
public Bdi WithItemprop(string? value = null)
public Bdi WithItemProp(string? value = null)
{
Itemprop = value;
ItemProp = value;
return this;
}
@@ -223,7 +208,7 @@ public readonly ref partial struct Bdi
return this;
}
public string? Spellcheck
public string? SpellCheck
{
set
{
@@ -233,9 +218,9 @@ public readonly ref partial struct Bdi
}
}
public Bdi WithSpellcheck(string? value = null)
public Bdi WithSpellCheck(string? value = null)
{
Spellcheck = value;
SpellCheck = value;
return this;
}
@@ -255,7 +240,7 @@ public readonly ref partial struct Bdi
return this;
}
public string? Tabindex
public string? TabIndex
{
set
{
@@ -265,9 +250,9 @@ public readonly ref partial struct Bdi
}
}
public Bdi WithTabindex(string? value = null)
public Bdi WithTabIndex(string? value = null)
{
Tabindex = value;
TabIndex = value;
return this;
}
@@ -303,36 +288,6 @@ public readonly ref partial struct Bdi
return this;
}
public Bdi WithCustomAttribute(string key, string? value = null)
{
WriteKey(key);
WriteValue(value);
return this;
}
public Bdi WithCustomAttributes(scoped ReadOnlySpan<(string, string?)> attributes)
{
foreach ((string key, string? value) in attributes)
{
WriteKey(key);
WriteValue(value);
}
return this;
}
private void WriteKey(string key)
{
writer.Write(' ');
writer.Write(key);
}
private void WriteValue(string? value)
{
writer.Write("=\"");
writer.Write(value);
writer.Write('"');
}
public void Close() => writer.Write($"></{ElementName}>");
/// <summary>
@@ -353,4 +308,31 @@ public readonly ref partial struct Bdi
writer.Write('>');
return new HtmlElementCloser(writer, $"</{ElementName}>");
}
// IHtmlElement<TSelf> implementation
TextWriter IHtmlElement<Bdi>.Writer => writer;
static Bdi IHtmlElement<Bdi>.Create(TextWriter writer) => new(writer);
static bool IHtmlElement<Bdi>.IsVoidElement => false;
static string IHtmlElement<Bdi>.Name => ElementName;
static ReadOnlySpan<string> IHtmlElement<Bdi>.SupportedAttributes => _supportedAttributes;
private static readonly string[] _supportedAttributes =
[
"accesskey",
"autocapitalize",
"class",
"contenteditable",
"dir",
"draggable",
"hidden",
"id",
"itemprop",
"lang",
"role",
"slot",
"spellcheck",
"style",
"tabindex",
"title",
"translate",
];
}
+44 -62
View File
@@ -4,7 +4,8 @@
namespace AssetRipper.Text.Html;
public readonly ref partial struct Bdo
public readonly ref partial struct Bdo : IHtmlElement<Bdo>,
IGlobalAttributes<Bdo>
{
private const string ElementName = "bdo";
private readonly TextWriter writer;
@@ -15,7 +16,7 @@ public readonly ref partial struct Bdo
writer.Write($"<{ElementName}");
}
public string? Accesskey
public string? AccessKey
{
set
{
@@ -25,9 +26,9 @@ public readonly ref partial struct Bdo
}
}
public Bdo WithAccesskey(string? value = null)
public Bdo WithAccessKey(string? value = null)
{
Accesskey = value;
AccessKey = value;
return this;
}
@@ -63,7 +64,7 @@ public readonly ref partial struct Bdo
return this;
}
public string? Contenteditable
public string? ContentEditable
{
set
{
@@ -73,25 +74,9 @@ public readonly ref partial struct Bdo
}
}
public Bdo WithContenteditable(string? value = null)
public Bdo WithContentEditable(string? value = null)
{
Contenteditable = value;
return this;
}
public string? Contextmenu
{
set
{
writer.Write(" contextmenu=\"");
writer.Write(value);
writer.Write('"');
}
}
public Bdo WithContextmenu(string? value = null)
{
Contextmenu = value;
ContentEditable = value;
return this;
}
@@ -159,7 +144,7 @@ public readonly ref partial struct Bdo
return this;
}
public string? Itemprop
public string? ItemProp
{
set
{
@@ -169,9 +154,9 @@ public readonly ref partial struct Bdo
}
}
public Bdo WithItemprop(string? value = null)
public Bdo WithItemProp(string? value = null)
{
Itemprop = value;
ItemProp = value;
return this;
}
@@ -223,7 +208,7 @@ public readonly ref partial struct Bdo
return this;
}
public string? Spellcheck
public string? SpellCheck
{
set
{
@@ -233,9 +218,9 @@ public readonly ref partial struct Bdo
}
}
public Bdo WithSpellcheck(string? value = null)
public Bdo WithSpellCheck(string? value = null)
{
Spellcheck = value;
SpellCheck = value;
return this;
}
@@ -255,7 +240,7 @@ public readonly ref partial struct Bdo
return this;
}
public string? Tabindex
public string? TabIndex
{
set
{
@@ -265,9 +250,9 @@ public readonly ref partial struct Bdo
}
}
public Bdo WithTabindex(string? value = null)
public Bdo WithTabIndex(string? value = null)
{
Tabindex = value;
TabIndex = value;
return this;
}
@@ -303,36 +288,6 @@ public readonly ref partial struct Bdo
return this;
}
public Bdo WithCustomAttribute(string key, string? value = null)
{
WriteKey(key);
WriteValue(value);
return this;
}
public Bdo WithCustomAttributes(scoped ReadOnlySpan<(string, string?)> attributes)
{
foreach ((string key, string? value) in attributes)
{
WriteKey(key);
WriteValue(value);
}
return this;
}
private void WriteKey(string key)
{
writer.Write(' ');
writer.Write(key);
}
private void WriteValue(string? value)
{
writer.Write("=\"");
writer.Write(value);
writer.Write('"');
}
public void Close() => writer.Write($"></{ElementName}>");
/// <summary>
@@ -353,4 +308,31 @@ public readonly ref partial struct Bdo
writer.Write('>');
return new HtmlElementCloser(writer, $"</{ElementName}>");
}
// IHtmlElement<TSelf> implementation
TextWriter IHtmlElement<Bdo>.Writer => writer;
static Bdo IHtmlElement<Bdo>.Create(TextWriter writer) => new(writer);
static bool IHtmlElement<Bdo>.IsVoidElement => false;
static string IHtmlElement<Bdo>.Name => ElementName;
static ReadOnlySpan<string> IHtmlElement<Bdo>.SupportedAttributes => _supportedAttributes;
private static readonly string[] _supportedAttributes =
[
"accesskey",
"autocapitalize",
"class",
"contenteditable",
"dir",
"draggable",
"hidden",
"id",
"itemprop",
"lang",
"role",
"slot",
"spellcheck",
"style",
"tabindex",
"title",
"translate",
];
}
+44 -62
View File
@@ -4,7 +4,8 @@
namespace AssetRipper.Text.Html;
public readonly ref partial struct Big
public readonly ref partial struct Big : IHtmlElement<Big>,
IGlobalAttributes<Big>
{
private const string ElementName = "big";
private readonly TextWriter writer;
@@ -15,7 +16,7 @@ public readonly ref partial struct Big
writer.Write($"<{ElementName}");
}
public string? Accesskey
public string? AccessKey
{
set
{
@@ -25,9 +26,9 @@ public readonly ref partial struct Big
}
}
public Big WithAccesskey(string? value = null)
public Big WithAccessKey(string? value = null)
{
Accesskey = value;
AccessKey = value;
return this;
}
@@ -63,7 +64,7 @@ public readonly ref partial struct Big
return this;
}
public string? Contenteditable
public string? ContentEditable
{
set
{
@@ -73,25 +74,9 @@ public readonly ref partial struct Big
}
}
public Big WithContenteditable(string? value = null)
public Big WithContentEditable(string? value = null)
{
Contenteditable = value;
return this;
}
public string? Contextmenu
{
set
{
writer.Write(" contextmenu=\"");
writer.Write(value);
writer.Write('"');
}
}
public Big WithContextmenu(string? value = null)
{
Contextmenu = value;
ContentEditable = value;
return this;
}
@@ -159,7 +144,7 @@ public readonly ref partial struct Big
return this;
}
public string? Itemprop
public string? ItemProp
{
set
{
@@ -169,9 +154,9 @@ public readonly ref partial struct Big
}
}
public Big WithItemprop(string? value = null)
public Big WithItemProp(string? value = null)
{
Itemprop = value;
ItemProp = value;
return this;
}
@@ -223,7 +208,7 @@ public readonly ref partial struct Big
return this;
}
public string? Spellcheck
public string? SpellCheck
{
set
{
@@ -233,9 +218,9 @@ public readonly ref partial struct Big
}
}
public Big WithSpellcheck(string? value = null)
public Big WithSpellCheck(string? value = null)
{
Spellcheck = value;
SpellCheck = value;
return this;
}
@@ -255,7 +240,7 @@ public readonly ref partial struct Big
return this;
}
public string? Tabindex
public string? TabIndex
{
set
{
@@ -265,9 +250,9 @@ public readonly ref partial struct Big
}
}
public Big WithTabindex(string? value = null)
public Big WithTabIndex(string? value = null)
{
Tabindex = value;
TabIndex = value;
return this;
}
@@ -303,36 +288,6 @@ public readonly ref partial struct Big
return this;
}
public Big WithCustomAttribute(string key, string? value = null)
{
WriteKey(key);
WriteValue(value);
return this;
}
public Big WithCustomAttributes(scoped ReadOnlySpan<(string, string?)> attributes)
{
foreach ((string key, string? value) in attributes)
{
WriteKey(key);
WriteValue(value);
}
return this;
}
private void WriteKey(string key)
{
writer.Write(' ');
writer.Write(key);
}
private void WriteValue(string? value)
{
writer.Write("=\"");
writer.Write(value);
writer.Write('"');
}
public void Close() => writer.Write($"></{ElementName}>");
/// <summary>
@@ -353,4 +308,31 @@ public readonly ref partial struct Big
writer.Write('>');
return new HtmlElementCloser(writer, $"</{ElementName}>");
}
// IHtmlElement<TSelf> implementation
TextWriter IHtmlElement<Big>.Writer => writer;
static Big IHtmlElement<Big>.Create(TextWriter writer) => new(writer);
static bool IHtmlElement<Big>.IsVoidElement => false;
static string IHtmlElement<Big>.Name => ElementName;
static ReadOnlySpan<string> IHtmlElement<Big>.SupportedAttributes => _supportedAttributes;
private static readonly string[] _supportedAttributes =
[
"accesskey",
"autocapitalize",
"class",
"contenteditable",
"dir",
"draggable",
"hidden",
"id",
"itemprop",
"lang",
"role",
"slot",
"spellcheck",
"style",
"tabindex",
"title",
"translate",
];
}
+46 -62
View File
@@ -4,7 +4,9 @@
namespace AssetRipper.Text.Html;
public readonly ref partial struct Blockquote
public readonly ref partial struct Blockquote : IHtmlElement<Blockquote>,
ICiteAttribute<Blockquote>,
IGlobalAttributes<Blockquote>
{
private const string ElementName = "blockquote";
private readonly TextWriter writer;
@@ -15,7 +17,7 @@ public readonly ref partial struct Blockquote
writer.Write($"<{ElementName}");
}
public string? Accesskey
public string? AccessKey
{
set
{
@@ -25,9 +27,9 @@ public readonly ref partial struct Blockquote
}
}
public Blockquote WithAccesskey(string? value = null)
public Blockquote WithAccessKey(string? value = null)
{
Accesskey = value;
AccessKey = value;
return this;
}
@@ -79,7 +81,7 @@ public readonly ref partial struct Blockquote
return this;
}
public string? Contenteditable
public string? ContentEditable
{
set
{
@@ -89,25 +91,9 @@ public readonly ref partial struct Blockquote
}
}
public Blockquote WithContenteditable(string? value = null)
public Blockquote WithContentEditable(string? value = null)
{
Contenteditable = value;
return this;
}
public string? Contextmenu
{
set
{
writer.Write(" contextmenu=\"");
writer.Write(value);
writer.Write('"');
}
}
public Blockquote WithContextmenu(string? value = null)
{
Contextmenu = value;
ContentEditable = value;
return this;
}
@@ -175,7 +161,7 @@ public readonly ref partial struct Blockquote
return this;
}
public string? Itemprop
public string? ItemProp
{
set
{
@@ -185,9 +171,9 @@ public readonly ref partial struct Blockquote
}
}
public Blockquote WithItemprop(string? value = null)
public Blockquote WithItemProp(string? value = null)
{
Itemprop = value;
ItemProp = value;
return this;
}
@@ -239,7 +225,7 @@ public readonly ref partial struct Blockquote
return this;
}
public string? Spellcheck
public string? SpellCheck
{
set
{
@@ -249,9 +235,9 @@ public readonly ref partial struct Blockquote
}
}
public Blockquote WithSpellcheck(string? value = null)
public Blockquote WithSpellCheck(string? value = null)
{
Spellcheck = value;
SpellCheck = value;
return this;
}
@@ -271,7 +257,7 @@ public readonly ref partial struct Blockquote
return this;
}
public string? Tabindex
public string? TabIndex
{
set
{
@@ -281,9 +267,9 @@ public readonly ref partial struct Blockquote
}
}
public Blockquote WithTabindex(string? value = null)
public Blockquote WithTabIndex(string? value = null)
{
Tabindex = value;
TabIndex = value;
return this;
}
@@ -319,36 +305,6 @@ public readonly ref partial struct Blockquote
return this;
}
public Blockquote WithCustomAttribute(string key, string? value = null)
{
WriteKey(key);
WriteValue(value);
return this;
}
public Blockquote WithCustomAttributes(scoped ReadOnlySpan<(string, string?)> attributes)
{
foreach ((string key, string? value) in attributes)
{
WriteKey(key);
WriteValue(value);
}
return this;
}
private void WriteKey(string key)
{
writer.Write(' ');
writer.Write(key);
}
private void WriteValue(string? value)
{
writer.Write("=\"");
writer.Write(value);
writer.Write('"');
}
public void Close() => writer.Write($"></{ElementName}>");
/// <summary>
@@ -369,4 +325,32 @@ public readonly ref partial struct Blockquote
writer.Write('>');
return new HtmlElementCloser(writer, $"</{ElementName}>");
}
// IHtmlElement<TSelf> implementation
TextWriter IHtmlElement<Blockquote>.Writer => writer;
static Blockquote IHtmlElement<Blockquote>.Create(TextWriter writer) => new(writer);
static bool IHtmlElement<Blockquote>.IsVoidElement => false;
static string IHtmlElement<Blockquote>.Name => ElementName;
static ReadOnlySpan<string> IHtmlElement<Blockquote>.SupportedAttributes => _supportedAttributes;
private static readonly string[] _supportedAttributes =
[
"accesskey",
"autocapitalize",
"cite",
"class",
"contenteditable",
"dir",
"draggable",
"hidden",
"id",
"itemprop",
"lang",
"role",
"slot",
"spellcheck",
"style",
"tabindex",
"title",
"translate",
];
}
+51 -65
View File
@@ -4,7 +4,10 @@
namespace AssetRipper.Text.Html;
public readonly ref partial struct Body
public readonly ref partial struct Body : IHtmlElement<Body>,
IBackgroundAttribute<Body>,
IBgColorAttribute<Body>,
IGlobalAttributes<Body>
{
private const string ElementName = "body";
private readonly TextWriter writer;
@@ -15,7 +18,7 @@ public readonly ref partial struct Body
writer.Write($"<{ElementName}");
}
public string? Accesskey
public string? AccessKey
{
set
{
@@ -25,9 +28,9 @@ public readonly ref partial struct Body
}
}
public Body WithAccesskey(string? value = null)
public Body WithAccessKey(string? value = null)
{
Accesskey = value;
AccessKey = value;
return this;
}
@@ -63,7 +66,7 @@ public readonly ref partial struct Body
return this;
}
public string? Bgcolor
public string? BgColor
{
set
{
@@ -73,9 +76,9 @@ public readonly ref partial struct Body
}
}
public Body WithBgcolor(string? value = null)
public Body WithBgColor(string? value = null)
{
Bgcolor = value;
BgColor = value;
return this;
}
@@ -95,7 +98,7 @@ public readonly ref partial struct Body
return this;
}
public string? Contenteditable
public string? ContentEditable
{
set
{
@@ -105,25 +108,9 @@ public readonly ref partial struct Body
}
}
public Body WithContenteditable(string? value = null)
public Body WithContentEditable(string? value = null)
{
Contenteditable = value;
return this;
}
public string? Contextmenu
{
set
{
writer.Write(" contextmenu=\"");
writer.Write(value);
writer.Write('"');
}
}
public Body WithContextmenu(string? value = null)
{
Contextmenu = value;
ContentEditable = value;
return this;
}
@@ -191,7 +178,7 @@ public readonly ref partial struct Body
return this;
}
public string? Itemprop
public string? ItemProp
{
set
{
@@ -201,9 +188,9 @@ public readonly ref partial struct Body
}
}
public Body WithItemprop(string? value = null)
public Body WithItemProp(string? value = null)
{
Itemprop = value;
ItemProp = value;
return this;
}
@@ -255,7 +242,7 @@ public readonly ref partial struct Body
return this;
}
public string? Spellcheck
public string? SpellCheck
{
set
{
@@ -265,9 +252,9 @@ public readonly ref partial struct Body
}
}
public Body WithSpellcheck(string? value = null)
public Body WithSpellCheck(string? value = null)
{
Spellcheck = value;
SpellCheck = value;
return this;
}
@@ -287,7 +274,7 @@ public readonly ref partial struct Body
return this;
}
public string? Tabindex
public string? TabIndex
{
set
{
@@ -297,9 +284,9 @@ public readonly ref partial struct Body
}
}
public Body WithTabindex(string? value = null)
public Body WithTabIndex(string? value = null)
{
Tabindex = value;
TabIndex = value;
return this;
}
@@ -335,36 +322,6 @@ public readonly ref partial struct Body
return this;
}
public Body WithCustomAttribute(string key, string? value = null)
{
WriteKey(key);
WriteValue(value);
return this;
}
public Body WithCustomAttributes(scoped ReadOnlySpan<(string, string?)> attributes)
{
foreach ((string key, string? value) in attributes)
{
WriteKey(key);
WriteValue(value);
}
return this;
}
private void WriteKey(string key)
{
writer.Write(' ');
writer.Write(key);
}
private void WriteValue(string? value)
{
writer.Write("=\"");
writer.Write(value);
writer.Write('"');
}
public void Close() => writer.Write($"></{ElementName}>");
/// <summary>
@@ -385,4 +342,33 @@ public readonly ref partial struct Body
writer.Write('>');
return new HtmlElementCloser(writer, $"</{ElementName}>");
}
// IHtmlElement<TSelf> implementation
TextWriter IHtmlElement<Body>.Writer => writer;
static Body IHtmlElement<Body>.Create(TextWriter writer) => new(writer);
static bool IHtmlElement<Body>.IsVoidElement => false;
static string IHtmlElement<Body>.Name => ElementName;
static ReadOnlySpan<string> IHtmlElement<Body>.SupportedAttributes => _supportedAttributes;
private static readonly string[] _supportedAttributes =
[
"accesskey",
"autocapitalize",
"background",
"bgcolor",
"class",
"contenteditable",
"dir",
"draggable",
"hidden",
"id",
"itemprop",
"lang",
"role",
"slot",
"spellcheck",
"style",
"tabindex",
"title",
"translate",
];
}
+46 -62
View File
@@ -4,7 +4,8 @@
namespace AssetRipper.Text.Html;
public readonly ref partial struct Br
public readonly ref partial struct Br : IHtmlElement<Br>,
IGlobalAttributes<Br>
{
private const string ElementName = "br";
private readonly TextWriter writer;
@@ -15,7 +16,7 @@ public readonly ref partial struct Br
writer.Write($"<{ElementName}");
}
public string? Accesskey
public string? AccessKey
{
set
{
@@ -25,9 +26,9 @@ public readonly ref partial struct Br
}
}
public Br WithAccesskey(string? value = null)
public Br WithAccessKey(string? value = null)
{
Accesskey = value;
AccessKey = value;
return this;
}
@@ -63,7 +64,7 @@ public readonly ref partial struct Br
return this;
}
public string? Contenteditable
public string? ContentEditable
{
set
{
@@ -73,25 +74,9 @@ public readonly ref partial struct Br
}
}
public Br WithContenteditable(string? value = null)
public Br WithContentEditable(string? value = null)
{
Contenteditable = value;
return this;
}
public string? Contextmenu
{
set
{
writer.Write(" contextmenu=\"");
writer.Write(value);
writer.Write('"');
}
}
public Br WithContextmenu(string? value = null)
{
Contextmenu = value;
ContentEditable = value;
return this;
}
@@ -159,7 +144,7 @@ public readonly ref partial struct Br
return this;
}
public string? Itemprop
public string? ItemProp
{
set
{
@@ -169,9 +154,9 @@ public readonly ref partial struct Br
}
}
public Br WithItemprop(string? value = null)
public Br WithItemProp(string? value = null)
{
Itemprop = value;
ItemProp = value;
return this;
}
@@ -223,7 +208,7 @@ public readonly ref partial struct Br
return this;
}
public string? Spellcheck
public string? SpellCheck
{
set
{
@@ -233,9 +218,9 @@ public readonly ref partial struct Br
}
}
public Br WithSpellcheck(string? value = null)
public Br WithSpellCheck(string? value = null)
{
Spellcheck = value;
SpellCheck = value;
return this;
}
@@ -255,7 +240,7 @@ public readonly ref partial struct Br
return this;
}
public string? Tabindex
public string? TabIndex
{
set
{
@@ -265,9 +250,9 @@ public readonly ref partial struct Br
}
}
public Br WithTabindex(string? value = null)
public Br WithTabIndex(string? value = null)
{
Tabindex = value;
TabIndex = value;
return this;
}
@@ -303,35 +288,34 @@ public readonly ref partial struct Br
return this;
}
public Br WithCustomAttribute(string key, string? value = null)
{
WriteKey(key);
WriteValue(value);
return this;
}
public Br WithCustomAttributes(scoped ReadOnlySpan<(string, string?)> attributes)
{
foreach ((string key, string? value) in attributes)
{
WriteKey(key);
WriteValue(value);
}
return this;
}
private void WriteKey(string key)
{
writer.Write(' ');
writer.Write(key);
}
private void WriteValue(string? value)
{
writer.Write("=\"");
writer.Write(value);
writer.Write('"');
}
public void Close() => writer.Write("/>");
HtmlElementCloser IHtmlElement<Br>.End() => throw new NotSupportedException();
// IHtmlElement<TSelf> implementation
TextWriter IHtmlElement<Br>.Writer => writer;
static Br IHtmlElement<Br>.Create(TextWriter writer) => new(writer);
static bool IHtmlElement<Br>.IsVoidElement => true;
static string IHtmlElement<Br>.Name => ElementName;
static ReadOnlySpan<string> IHtmlElement<Br>.SupportedAttributes => _supportedAttributes;
private static readonly string[] _supportedAttributes =
[
"accesskey",
"autocapitalize",
"class",
"contenteditable",
"dir",
"draggable",
"hidden",
"id",
"itemprop",
"lang",
"role",
"slot",
"spellcheck",
"style",
"tabindex",
"title",
"translate",
];
}
+79 -77
View File
@@ -4,7 +4,18 @@
namespace AssetRipper.Text.Html;
public readonly ref partial struct Button
public readonly ref partial struct Button : IHtmlElement<Button>,
IDisabledAttribute<Button>,
IFormAttribute<Button>,
IFormActionAttribute<Button>,
IFormEncTypeAttribute<Button>,
IFormMethodAttribute<Button>,
IFormNoValidateAttribute<Button>,
IFormTargetAttribute<Button>,
INameAttribute<Button>,
ITypeAttribute<Button>,
IValueAttribute<Button>,
IGlobalAttributes<Button>
{
private const string ElementName = "button";
private readonly TextWriter writer;
@@ -15,7 +26,7 @@ public readonly ref partial struct Button
writer.Write($"<{ElementName}");
}
public string? Accesskey
public string? AccessKey
{
set
{
@@ -25,9 +36,9 @@ public readonly ref partial struct Button
}
}
public Button WithAccesskey(string? value = null)
public Button WithAccessKey(string? value = null)
{
Accesskey = value;
AccessKey = value;
return this;
}
@@ -63,7 +74,7 @@ public readonly ref partial struct Button
return this;
}
public string? Contenteditable
public string? ContentEditable
{
set
{
@@ -73,25 +84,9 @@ public readonly ref partial struct Button
}
}
public Button WithContenteditable(string? value = null)
public Button WithContentEditable(string? value = null)
{
Contenteditable = value;
return this;
}
public string? Contextmenu
{
set
{
writer.Write(" contextmenu=\"");
writer.Write(value);
writer.Write('"');
}
}
public Button WithContextmenu(string? value = null)
{
Contextmenu = value;
ContentEditable = value;
return this;
}
@@ -159,7 +154,7 @@ public readonly ref partial struct Button
return this;
}
public string? Formaction
public string? FormAction
{
set
{
@@ -169,13 +164,13 @@ public readonly ref partial struct Button
}
}
public Button WithFormaction(string? value = null)
public Button WithFormAction(string? value = null)
{
Formaction = value;
FormAction = value;
return this;
}
public string? Formenctype
public string? FormEncType
{
set
{
@@ -185,13 +180,13 @@ public readonly ref partial struct Button
}
}
public Button WithFormenctype(string? value = null)
public Button WithFormEncType(string? value = null)
{
Formenctype = value;
FormEncType = value;
return this;
}
public string? Formmethod
public string? FormMethod
{
set
{
@@ -201,13 +196,13 @@ public readonly ref partial struct Button
}
}
public Button WithFormmethod(string? value = null)
public Button WithFormMethod(string? value = null)
{
Formmethod = value;
FormMethod = value;
return this;
}
public string? Formnovalidate
public string? FormNoValidate
{
set
{
@@ -217,13 +212,13 @@ public readonly ref partial struct Button
}
}
public Button WithFormnovalidate(string? value = null)
public Button WithFormNoValidate(string? value = null)
{
Formnovalidate = value;
FormNoValidate = value;
return this;
}
public string? Formtarget
public string? FormTarget
{
set
{
@@ -233,9 +228,9 @@ public readonly ref partial struct Button
}
}
public Button WithFormtarget(string? value = null)
public Button WithFormTarget(string? value = null)
{
Formtarget = value;
FormTarget = value;
return this;
}
@@ -271,7 +266,7 @@ public readonly ref partial struct Button
return this;
}
public string? Itemprop
public string? ItemProp
{
set
{
@@ -281,9 +276,9 @@ public readonly ref partial struct Button
}
}
public Button WithItemprop(string? value = null)
public Button WithItemProp(string? value = null)
{
Itemprop = value;
ItemProp = value;
return this;
}
@@ -351,7 +346,7 @@ public readonly ref partial struct Button
return this;
}
public string? Spellcheck
public string? SpellCheck
{
set
{
@@ -361,9 +356,9 @@ public readonly ref partial struct Button
}
}
public Button WithSpellcheck(string? value = null)
public Button WithSpellCheck(string? value = null)
{
Spellcheck = value;
SpellCheck = value;
return this;
}
@@ -383,7 +378,7 @@ public readonly ref partial struct Button
return this;
}
public string? Tabindex
public string? TabIndex
{
set
{
@@ -393,9 +388,9 @@ public readonly ref partial struct Button
}
}
public Button WithTabindex(string? value = null)
public Button WithTabIndex(string? value = null)
{
Tabindex = value;
TabIndex = value;
return this;
}
@@ -463,36 +458,6 @@ public readonly ref partial struct Button
return this;
}
public Button WithCustomAttribute(string key, string? value = null)
{
WriteKey(key);
WriteValue(value);
return this;
}
public Button WithCustomAttributes(scoped ReadOnlySpan<(string, string?)> attributes)
{
foreach ((string key, string? value) in attributes)
{
WriteKey(key);
WriteValue(value);
}
return this;
}
private void WriteKey(string key)
{
writer.Write(' ');
writer.Write(key);
}
private void WriteValue(string? value)
{
writer.Write("=\"");
writer.Write(value);
writer.Write('"');
}
public void Close() => writer.Write($"></{ElementName}>");
/// <summary>
@@ -513,4 +478,41 @@ public readonly ref partial struct Button
writer.Write('>');
return new HtmlElementCloser(writer, $"</{ElementName}>");
}
// IHtmlElement<TSelf> implementation
TextWriter IHtmlElement<Button>.Writer => writer;
static Button IHtmlElement<Button>.Create(TextWriter writer) => new(writer);
static bool IHtmlElement<Button>.IsVoidElement => false;
static string IHtmlElement<Button>.Name => ElementName;
static ReadOnlySpan<string> IHtmlElement<Button>.SupportedAttributes => _supportedAttributes;
private static readonly string[] _supportedAttributes =
[
"accesskey",
"autocapitalize",
"class",
"contenteditable",
"dir",
"disabled",
"draggable",
"form",
"formaction",
"formenctype",
"formmethod",
"formnovalidate",
"formtarget",
"hidden",
"id",
"itemprop",
"lang",
"name",
"role",
"slot",
"spellcheck",
"style",
"tabindex",
"title",
"translate",
"type",
"value",
];
}
+48 -62
View File
@@ -4,7 +4,10 @@
namespace AssetRipper.Text.Html;
public readonly ref partial struct Canvas
public readonly ref partial struct Canvas : IHtmlElement<Canvas>,
IHeightAttribute<Canvas>,
IWidthAttribute<Canvas>,
IGlobalAttributes<Canvas>
{
private const string ElementName = "canvas";
private readonly TextWriter writer;
@@ -15,7 +18,7 @@ public readonly ref partial struct Canvas
writer.Write($"<{ElementName}");
}
public string? Accesskey
public string? AccessKey
{
set
{
@@ -25,9 +28,9 @@ public readonly ref partial struct Canvas
}
}
public Canvas WithAccesskey(string? value = null)
public Canvas WithAccessKey(string? value = null)
{
Accesskey = value;
AccessKey = value;
return this;
}
@@ -63,7 +66,7 @@ public readonly ref partial struct Canvas
return this;
}
public string? Contenteditable
public string? ContentEditable
{
set
{
@@ -73,25 +76,9 @@ public readonly ref partial struct Canvas
}
}
public Canvas WithContenteditable(string? value = null)
public Canvas WithContentEditable(string? value = null)
{
Contenteditable = value;
return this;
}
public string? Contextmenu
{
set
{
writer.Write(" contextmenu=\"");
writer.Write(value);
writer.Write('"');
}
}
public Canvas WithContextmenu(string? value = null)
{
Contextmenu = value;
ContentEditable = value;
return this;
}
@@ -175,7 +162,7 @@ public readonly ref partial struct Canvas
return this;
}
public string? Itemprop
public string? ItemProp
{
set
{
@@ -185,9 +172,9 @@ public readonly ref partial struct Canvas
}
}
public Canvas WithItemprop(string? value = null)
public Canvas WithItemProp(string? value = null)
{
Itemprop = value;
ItemProp = value;
return this;
}
@@ -239,7 +226,7 @@ public readonly ref partial struct Canvas
return this;
}
public string? Spellcheck
public string? SpellCheck
{
set
{
@@ -249,9 +236,9 @@ public readonly ref partial struct Canvas
}
}
public Canvas WithSpellcheck(string? value = null)
public Canvas WithSpellCheck(string? value = null)
{
Spellcheck = value;
SpellCheck = value;
return this;
}
@@ -271,7 +258,7 @@ public readonly ref partial struct Canvas
return this;
}
public string? Tabindex
public string? TabIndex
{
set
{
@@ -281,9 +268,9 @@ public readonly ref partial struct Canvas
}
}
public Canvas WithTabindex(string? value = null)
public Canvas WithTabIndex(string? value = null)
{
Tabindex = value;
TabIndex = value;
return this;
}
@@ -335,36 +322,6 @@ public readonly ref partial struct Canvas
return this;
}
public Canvas WithCustomAttribute(string key, string? value = null)
{
WriteKey(key);
WriteValue(value);
return this;
}
public Canvas WithCustomAttributes(scoped ReadOnlySpan<(string, string?)> attributes)
{
foreach ((string key, string? value) in attributes)
{
WriteKey(key);
WriteValue(value);
}
return this;
}
private void WriteKey(string key)
{
writer.Write(' ');
writer.Write(key);
}
private void WriteValue(string? value)
{
writer.Write("=\"");
writer.Write(value);
writer.Write('"');
}
public void Close() => writer.Write($"></{ElementName}>");
/// <summary>
@@ -385,4 +342,33 @@ public readonly ref partial struct Canvas
writer.Write('>');
return new HtmlElementCloser(writer, $"</{ElementName}>");
}
// IHtmlElement<TSelf> implementation
TextWriter IHtmlElement<Canvas>.Writer => writer;
static Canvas IHtmlElement<Canvas>.Create(TextWriter writer) => new(writer);
static bool IHtmlElement<Canvas>.IsVoidElement => false;
static string IHtmlElement<Canvas>.Name => ElementName;
static ReadOnlySpan<string> IHtmlElement<Canvas>.SupportedAttributes => _supportedAttributes;
private static readonly string[] _supportedAttributes =
[
"accesskey",
"autocapitalize",
"class",
"contenteditable",
"dir",
"draggable",
"height",
"hidden",
"id",
"itemprop",
"lang",
"role",
"slot",
"spellcheck",
"style",
"tabindex",
"title",
"translate",
"width",
];
}
+46 -62
View File
@@ -4,7 +4,9 @@
namespace AssetRipper.Text.Html;
public readonly ref partial struct Caption
public readonly ref partial struct Caption : IHtmlElement<Caption>,
IAlignAttribute<Caption>,
IGlobalAttributes<Caption>
{
private const string ElementName = "caption";
private readonly TextWriter writer;
@@ -15,7 +17,7 @@ public readonly ref partial struct Caption
writer.Write($"<{ElementName}");
}
public string? Accesskey
public string? AccessKey
{
set
{
@@ -25,9 +27,9 @@ public readonly ref partial struct Caption
}
}
public Caption WithAccesskey(string? value = null)
public Caption WithAccessKey(string? value = null)
{
Accesskey = value;
AccessKey = value;
return this;
}
@@ -79,7 +81,7 @@ public readonly ref partial struct Caption
return this;
}
public string? Contenteditable
public string? ContentEditable
{
set
{
@@ -89,25 +91,9 @@ public readonly ref partial struct Caption
}
}
public Caption WithContenteditable(string? value = null)
public Caption WithContentEditable(string? value = null)
{
Contenteditable = value;
return this;
}
public string? Contextmenu
{
set
{
writer.Write(" contextmenu=\"");
writer.Write(value);
writer.Write('"');
}
}
public Caption WithContextmenu(string? value = null)
{
Contextmenu = value;
ContentEditable = value;
return this;
}
@@ -175,7 +161,7 @@ public readonly ref partial struct Caption
return this;
}
public string? Itemprop
public string? ItemProp
{
set
{
@@ -185,9 +171,9 @@ public readonly ref partial struct Caption
}
}
public Caption WithItemprop(string? value = null)
public Caption WithItemProp(string? value = null)
{
Itemprop = value;
ItemProp = value;
return this;
}
@@ -239,7 +225,7 @@ public readonly ref partial struct Caption
return this;
}
public string? Spellcheck
public string? SpellCheck
{
set
{
@@ -249,9 +235,9 @@ public readonly ref partial struct Caption
}
}
public Caption WithSpellcheck(string? value = null)
public Caption WithSpellCheck(string? value = null)
{
Spellcheck = value;
SpellCheck = value;
return this;
}
@@ -271,7 +257,7 @@ public readonly ref partial struct Caption
return this;
}
public string? Tabindex
public string? TabIndex
{
set
{
@@ -281,9 +267,9 @@ public readonly ref partial struct Caption
}
}
public Caption WithTabindex(string? value = null)
public Caption WithTabIndex(string? value = null)
{
Tabindex = value;
TabIndex = value;
return this;
}
@@ -319,36 +305,6 @@ public readonly ref partial struct Caption
return this;
}
public Caption WithCustomAttribute(string key, string? value = null)
{
WriteKey(key);
WriteValue(value);
return this;
}
public Caption WithCustomAttributes(scoped ReadOnlySpan<(string, string?)> attributes)
{
foreach ((string key, string? value) in attributes)
{
WriteKey(key);
WriteValue(value);
}
return this;
}
private void WriteKey(string key)
{
writer.Write(' ');
writer.Write(key);
}
private void WriteValue(string? value)
{
writer.Write("=\"");
writer.Write(value);
writer.Write('"');
}
public void Close() => writer.Write($"></{ElementName}>");
/// <summary>
@@ -369,4 +325,32 @@ public readonly ref partial struct Caption
writer.Write('>');
return new HtmlElementCloser(writer, $"</{ElementName}>");
}
// IHtmlElement<TSelf> implementation
TextWriter IHtmlElement<Caption>.Writer => writer;
static Caption IHtmlElement<Caption>.Create(TextWriter writer) => new(writer);
static bool IHtmlElement<Caption>.IsVoidElement => false;
static string IHtmlElement<Caption>.Name => ElementName;
static ReadOnlySpan<string> IHtmlElement<Caption>.SupportedAttributes => _supportedAttributes;
private static readonly string[] _supportedAttributes =
[
"accesskey",
"align",
"autocapitalize",
"class",
"contenteditable",
"dir",
"draggable",
"hidden",
"id",
"itemprop",
"lang",
"role",
"slot",
"spellcheck",
"style",
"tabindex",
"title",
"translate",
];
}
+44 -62
View File
@@ -4,7 +4,8 @@
namespace AssetRipper.Text.Html;
public readonly ref partial struct Center
public readonly ref partial struct Center : IHtmlElement<Center>,
IGlobalAttributes<Center>
{
private const string ElementName = "center";
private readonly TextWriter writer;
@@ -15,7 +16,7 @@ public readonly ref partial struct Center
writer.Write($"<{ElementName}");
}
public string? Accesskey
public string? AccessKey
{
set
{
@@ -25,9 +26,9 @@ public readonly ref partial struct Center
}
}
public Center WithAccesskey(string? value = null)
public Center WithAccessKey(string? value = null)
{
Accesskey = value;
AccessKey = value;
return this;
}
@@ -63,7 +64,7 @@ public readonly ref partial struct Center
return this;
}
public string? Contenteditable
public string? ContentEditable
{
set
{
@@ -73,25 +74,9 @@ public readonly ref partial struct Center
}
}
public Center WithContenteditable(string? value = null)
public Center WithContentEditable(string? value = null)
{
Contenteditable = value;
return this;
}
public string? Contextmenu
{
set
{
writer.Write(" contextmenu=\"");
writer.Write(value);
writer.Write('"');
}
}
public Center WithContextmenu(string? value = null)
{
Contextmenu = value;
ContentEditable = value;
return this;
}
@@ -159,7 +144,7 @@ public readonly ref partial struct Center
return this;
}
public string? Itemprop
public string? ItemProp
{
set
{
@@ -169,9 +154,9 @@ public readonly ref partial struct Center
}
}
public Center WithItemprop(string? value = null)
public Center WithItemProp(string? value = null)
{
Itemprop = value;
ItemProp = value;
return this;
}
@@ -223,7 +208,7 @@ public readonly ref partial struct Center
return this;
}
public string? Spellcheck
public string? SpellCheck
{
set
{
@@ -233,9 +218,9 @@ public readonly ref partial struct Center
}
}
public Center WithSpellcheck(string? value = null)
public Center WithSpellCheck(string? value = null)
{
Spellcheck = value;
SpellCheck = value;
return this;
}
@@ -255,7 +240,7 @@ public readonly ref partial struct Center
return this;
}
public string? Tabindex
public string? TabIndex
{
set
{
@@ -265,9 +250,9 @@ public readonly ref partial struct Center
}
}
public Center WithTabindex(string? value = null)
public Center WithTabIndex(string? value = null)
{
Tabindex = value;
TabIndex = value;
return this;
}
@@ -303,36 +288,6 @@ public readonly ref partial struct Center
return this;
}
public Center WithCustomAttribute(string key, string? value = null)
{
WriteKey(key);
WriteValue(value);
return this;
}
public Center WithCustomAttributes(scoped ReadOnlySpan<(string, string?)> attributes)
{
foreach ((string key, string? value) in attributes)
{
WriteKey(key);
WriteValue(value);
}
return this;
}
private void WriteKey(string key)
{
writer.Write(' ');
writer.Write(key);
}
private void WriteValue(string? value)
{
writer.Write("=\"");
writer.Write(value);
writer.Write('"');
}
public void Close() => writer.Write($"></{ElementName}>");
/// <summary>
@@ -353,4 +308,31 @@ public readonly ref partial struct Center
writer.Write('>');
return new HtmlElementCloser(writer, $"</{ElementName}>");
}
// IHtmlElement<TSelf> implementation
TextWriter IHtmlElement<Center>.Writer => writer;
static Center IHtmlElement<Center>.Create(TextWriter writer) => new(writer);
static bool IHtmlElement<Center>.IsVoidElement => false;
static string IHtmlElement<Center>.Name => ElementName;
static ReadOnlySpan<string> IHtmlElement<Center>.SupportedAttributes => _supportedAttributes;
private static readonly string[] _supportedAttributes =
[
"accesskey",
"autocapitalize",
"class",
"contenteditable",
"dir",
"draggable",
"hidden",
"id",
"itemprop",
"lang",
"role",
"slot",
"spellcheck",
"style",
"tabindex",
"title",
"translate",
];
}
+44 -62
View File
@@ -4,7 +4,8 @@
namespace AssetRipper.Text.Html;
public readonly ref partial struct Cite
public readonly ref partial struct Cite : IHtmlElement<Cite>,
IGlobalAttributes<Cite>
{
private const string ElementName = "cite";
private readonly TextWriter writer;
@@ -15,7 +16,7 @@ public readonly ref partial struct Cite
writer.Write($"<{ElementName}");
}
public string? Accesskey
public string? AccessKey
{
set
{
@@ -25,9 +26,9 @@ public readonly ref partial struct Cite
}
}
public Cite WithAccesskey(string? value = null)
public Cite WithAccessKey(string? value = null)
{
Accesskey = value;
AccessKey = value;
return this;
}
@@ -63,7 +64,7 @@ public readonly ref partial struct Cite
return this;
}
public string? Contenteditable
public string? ContentEditable
{
set
{
@@ -73,25 +74,9 @@ public readonly ref partial struct Cite
}
}
public Cite WithContenteditable(string? value = null)
public Cite WithContentEditable(string? value = null)
{
Contenteditable = value;
return this;
}
public string? Contextmenu
{
set
{
writer.Write(" contextmenu=\"");
writer.Write(value);
writer.Write('"');
}
}
public Cite WithContextmenu(string? value = null)
{
Contextmenu = value;
ContentEditable = value;
return this;
}
@@ -159,7 +144,7 @@ public readonly ref partial struct Cite
return this;
}
public string? Itemprop
public string? ItemProp
{
set
{
@@ -169,9 +154,9 @@ public readonly ref partial struct Cite
}
}
public Cite WithItemprop(string? value = null)
public Cite WithItemProp(string? value = null)
{
Itemprop = value;
ItemProp = value;
return this;
}
@@ -223,7 +208,7 @@ public readonly ref partial struct Cite
return this;
}
public string? Spellcheck
public string? SpellCheck
{
set
{
@@ -233,9 +218,9 @@ public readonly ref partial struct Cite
}
}
public Cite WithSpellcheck(string? value = null)
public Cite WithSpellCheck(string? value = null)
{
Spellcheck = value;
SpellCheck = value;
return this;
}
@@ -255,7 +240,7 @@ public readonly ref partial struct Cite
return this;
}
public string? Tabindex
public string? TabIndex
{
set
{
@@ -265,9 +250,9 @@ public readonly ref partial struct Cite
}
}
public Cite WithTabindex(string? value = null)
public Cite WithTabIndex(string? value = null)
{
Tabindex = value;
TabIndex = value;
return this;
}
@@ -303,36 +288,6 @@ public readonly ref partial struct Cite
return this;
}
public Cite WithCustomAttribute(string key, string? value = null)
{
WriteKey(key);
WriteValue(value);
return this;
}
public Cite WithCustomAttributes(scoped ReadOnlySpan<(string, string?)> attributes)
{
foreach ((string key, string? value) in attributes)
{
WriteKey(key);
WriteValue(value);
}
return this;
}
private void WriteKey(string key)
{
writer.Write(' ');
writer.Write(key);
}
private void WriteValue(string? value)
{
writer.Write("=\"");
writer.Write(value);
writer.Write('"');
}
public void Close() => writer.Write($"></{ElementName}>");
/// <summary>
@@ -353,4 +308,31 @@ public readonly ref partial struct Cite
writer.Write('>');
return new HtmlElementCloser(writer, $"</{ElementName}>");
}
// IHtmlElement<TSelf> implementation
TextWriter IHtmlElement<Cite>.Writer => writer;
static Cite IHtmlElement<Cite>.Create(TextWriter writer) => new(writer);
static bool IHtmlElement<Cite>.IsVoidElement => false;
static string IHtmlElement<Cite>.Name => ElementName;
static ReadOnlySpan<string> IHtmlElement<Cite>.SupportedAttributes => _supportedAttributes;
private static readonly string[] _supportedAttributes =
[
"accesskey",
"autocapitalize",
"class",
"contenteditable",
"dir",
"draggable",
"hidden",
"id",
"itemprop",
"lang",
"role",
"slot",
"spellcheck",
"style",
"tabindex",
"title",
"translate",
];
}
+44 -62
View File
@@ -4,7 +4,8 @@
namespace AssetRipper.Text.Html;
public readonly ref partial struct Code
public readonly ref partial struct Code : IHtmlElement<Code>,
IGlobalAttributes<Code>
{
private const string ElementName = "code";
private readonly TextWriter writer;
@@ -15,7 +16,7 @@ public readonly ref partial struct Code
writer.Write($"<{ElementName}");
}
public string? Accesskey
public string? AccessKey
{
set
{
@@ -25,9 +26,9 @@ public readonly ref partial struct Code
}
}
public Code WithAccesskey(string? value = null)
public Code WithAccessKey(string? value = null)
{
Accesskey = value;
AccessKey = value;
return this;
}
@@ -63,7 +64,7 @@ public readonly ref partial struct Code
return this;
}
public string? Contenteditable
public string? ContentEditable
{
set
{
@@ -73,25 +74,9 @@ public readonly ref partial struct Code
}
}
public Code WithContenteditable(string? value = null)
public Code WithContentEditable(string? value = null)
{
Contenteditable = value;
return this;
}
public string? Contextmenu
{
set
{
writer.Write(" contextmenu=\"");
writer.Write(value);
writer.Write('"');
}
}
public Code WithContextmenu(string? value = null)
{
Contextmenu = value;
ContentEditable = value;
return this;
}
@@ -159,7 +144,7 @@ public readonly ref partial struct Code
return this;
}
public string? Itemprop
public string? ItemProp
{
set
{
@@ -169,9 +154,9 @@ public readonly ref partial struct Code
}
}
public Code WithItemprop(string? value = null)
public Code WithItemProp(string? value = null)
{
Itemprop = value;
ItemProp = value;
return this;
}
@@ -223,7 +208,7 @@ public readonly ref partial struct Code
return this;
}
public string? Spellcheck
public string? SpellCheck
{
set
{
@@ -233,9 +218,9 @@ public readonly ref partial struct Code
}
}
public Code WithSpellcheck(string? value = null)
public Code WithSpellCheck(string? value = null)
{
Spellcheck = value;
SpellCheck = value;
return this;
}
@@ -255,7 +240,7 @@ public readonly ref partial struct Code
return this;
}
public string? Tabindex
public string? TabIndex
{
set
{
@@ -265,9 +250,9 @@ public readonly ref partial struct Code
}
}
public Code WithTabindex(string? value = null)
public Code WithTabIndex(string? value = null)
{
Tabindex = value;
TabIndex = value;
return this;
}
@@ -303,36 +288,6 @@ public readonly ref partial struct Code
return this;
}
public Code WithCustomAttribute(string key, string? value = null)
{
WriteKey(key);
WriteValue(value);
return this;
}
public Code WithCustomAttributes(scoped ReadOnlySpan<(string, string?)> attributes)
{
foreach ((string key, string? value) in attributes)
{
WriteKey(key);
WriteValue(value);
}
return this;
}
private void WriteKey(string key)
{
writer.Write(' ');
writer.Write(key);
}
private void WriteValue(string? value)
{
writer.Write("=\"");
writer.Write(value);
writer.Write('"');
}
public void Close() => writer.Write($"></{ElementName}>");
/// <summary>
@@ -353,4 +308,31 @@ public readonly ref partial struct Code
writer.Write('>');
return new HtmlElementCloser(writer, $"</{ElementName}>");
}
// IHtmlElement<TSelf> implementation
TextWriter IHtmlElement<Code>.Writer => writer;
static Code IHtmlElement<Code>.Create(TextWriter writer) => new(writer);
static bool IHtmlElement<Code>.IsVoidElement => false;
static string IHtmlElement<Code>.Name => ElementName;
static ReadOnlySpan<string> IHtmlElement<Code>.SupportedAttributes => _supportedAttributes;
private static readonly string[] _supportedAttributes =
[
"accesskey",
"autocapitalize",
"class",
"contenteditable",
"dir",
"draggable",
"hidden",
"id",
"itemprop",
"lang",
"role",
"slot",
"spellcheck",
"style",
"tabindex",
"title",
"translate",
];
}
+55 -65
View File
@@ -4,7 +4,11 @@
namespace AssetRipper.Text.Html;
public readonly ref partial struct Col
public readonly ref partial struct Col : IHtmlElement<Col>,
IAlignAttribute<Col>,
IBgColorAttribute<Col>,
ISpanAttribute<Col>,
IGlobalAttributes<Col>
{
private const string ElementName = "col";
private readonly TextWriter writer;
@@ -15,7 +19,7 @@ public readonly ref partial struct Col
writer.Write($"<{ElementName}");
}
public string? Accesskey
public string? AccessKey
{
set
{
@@ -25,9 +29,9 @@ public readonly ref partial struct Col
}
}
public Col WithAccesskey(string? value = null)
public Col WithAccessKey(string? value = null)
{
Accesskey = value;
AccessKey = value;
return this;
}
@@ -63,7 +67,7 @@ public readonly ref partial struct Col
return this;
}
public string? Bgcolor
public string? BgColor
{
set
{
@@ -73,9 +77,9 @@ public readonly ref partial struct Col
}
}
public Col WithBgcolor(string? value = null)
public Col WithBgColor(string? value = null)
{
Bgcolor = value;
BgColor = value;
return this;
}
@@ -95,7 +99,7 @@ public readonly ref partial struct Col
return this;
}
public string? Contenteditable
public string? ContentEditable
{
set
{
@@ -105,25 +109,9 @@ public readonly ref partial struct Col
}
}
public Col WithContenteditable(string? value = null)
public Col WithContentEditable(string? value = null)
{
Contenteditable = value;
return this;
}
public string? Contextmenu
{
set
{
writer.Write(" contextmenu=\"");
writer.Write(value);
writer.Write('"');
}
}
public Col WithContextmenu(string? value = null)
{
Contextmenu = value;
ContentEditable = value;
return this;
}
@@ -191,7 +179,7 @@ public readonly ref partial struct Col
return this;
}
public string? Itemprop
public string? ItemProp
{
set
{
@@ -201,9 +189,9 @@ public readonly ref partial struct Col
}
}
public Col WithItemprop(string? value = null)
public Col WithItemProp(string? value = null)
{
Itemprop = value;
ItemProp = value;
return this;
}
@@ -271,7 +259,7 @@ public readonly ref partial struct Col
return this;
}
public string? Spellcheck
public string? SpellCheck
{
set
{
@@ -281,9 +269,9 @@ public readonly ref partial struct Col
}
}
public Col WithSpellcheck(string? value = null)
public Col WithSpellCheck(string? value = null)
{
Spellcheck = value;
SpellCheck = value;
return this;
}
@@ -303,7 +291,7 @@ public readonly ref partial struct Col
return this;
}
public string? Tabindex
public string? TabIndex
{
set
{
@@ -313,9 +301,9 @@ public readonly ref partial struct Col
}
}
public Col WithTabindex(string? value = null)
public Col WithTabIndex(string? value = null)
{
Tabindex = value;
TabIndex = value;
return this;
}
@@ -351,35 +339,37 @@ public readonly ref partial struct Col
return this;
}
public Col WithCustomAttribute(string key, string? value = null)
{
WriteKey(key);
WriteValue(value);
return this;
}
public Col WithCustomAttributes(scoped ReadOnlySpan<(string, string?)> attributes)
{
foreach ((string key, string? value) in attributes)
{
WriteKey(key);
WriteValue(value);
}
return this;
}
private void WriteKey(string key)
{
writer.Write(' ');
writer.Write(key);
}
private void WriteValue(string? value)
{
writer.Write("=\"");
writer.Write(value);
writer.Write('"');
}
public void Close() => writer.Write("/>");
HtmlElementCloser IHtmlElement<Col>.End() => throw new NotSupportedException();
// IHtmlElement<TSelf> implementation
TextWriter IHtmlElement<Col>.Writer => writer;
static Col IHtmlElement<Col>.Create(TextWriter writer) => new(writer);
static bool IHtmlElement<Col>.IsVoidElement => true;
static string IHtmlElement<Col>.Name => ElementName;
static ReadOnlySpan<string> IHtmlElement<Col>.SupportedAttributes => _supportedAttributes;
private static readonly string[] _supportedAttributes =
[
"accesskey",
"align",
"autocapitalize",
"bgcolor",
"class",
"contenteditable",
"dir",
"draggable",
"hidden",
"id",
"itemprop",
"lang",
"role",
"slot",
"span",
"spellcheck",
"style",
"tabindex",
"title",
"translate",
];
}
+53 -65
View File
@@ -4,7 +4,11 @@
namespace AssetRipper.Text.Html;
public readonly ref partial struct Colgroup
public readonly ref partial struct Colgroup : IHtmlElement<Colgroup>,
IAlignAttribute<Colgroup>,
IBgColorAttribute<Colgroup>,
ISpanAttribute<Colgroup>,
IGlobalAttributes<Colgroup>
{
private const string ElementName = "colgroup";
private readonly TextWriter writer;
@@ -15,7 +19,7 @@ public readonly ref partial struct Colgroup
writer.Write($"<{ElementName}");
}
public string? Accesskey
public string? AccessKey
{
set
{
@@ -25,9 +29,9 @@ public readonly ref partial struct Colgroup
}
}
public Colgroup WithAccesskey(string? value = null)
public Colgroup WithAccessKey(string? value = null)
{
Accesskey = value;
AccessKey = value;
return this;
}
@@ -63,7 +67,7 @@ public readonly ref partial struct Colgroup
return this;
}
public string? Bgcolor
public string? BgColor
{
set
{
@@ -73,9 +77,9 @@ public readonly ref partial struct Colgroup
}
}
public Colgroup WithBgcolor(string? value = null)
public Colgroup WithBgColor(string? value = null)
{
Bgcolor = value;
BgColor = value;
return this;
}
@@ -95,7 +99,7 @@ public readonly ref partial struct Colgroup
return this;
}
public string? Contenteditable
public string? ContentEditable
{
set
{
@@ -105,25 +109,9 @@ public readonly ref partial struct Colgroup
}
}
public Colgroup WithContenteditable(string? value = null)
public Colgroup WithContentEditable(string? value = null)
{
Contenteditable = value;
return this;
}
public string? Contextmenu
{
set
{
writer.Write(" contextmenu=\"");
writer.Write(value);
writer.Write('"');
}
}
public Colgroup WithContextmenu(string? value = null)
{
Contextmenu = value;
ContentEditable = value;
return this;
}
@@ -191,7 +179,7 @@ public readonly ref partial struct Colgroup
return this;
}
public string? Itemprop
public string? ItemProp
{
set
{
@@ -201,9 +189,9 @@ public readonly ref partial struct Colgroup
}
}
public Colgroup WithItemprop(string? value = null)
public Colgroup WithItemProp(string? value = null)
{
Itemprop = value;
ItemProp = value;
return this;
}
@@ -271,7 +259,7 @@ public readonly ref partial struct Colgroup
return this;
}
public string? Spellcheck
public string? SpellCheck
{
set
{
@@ -281,9 +269,9 @@ public readonly ref partial struct Colgroup
}
}
public Colgroup WithSpellcheck(string? value = null)
public Colgroup WithSpellCheck(string? value = null)
{
Spellcheck = value;
SpellCheck = value;
return this;
}
@@ -303,7 +291,7 @@ public readonly ref partial struct Colgroup
return this;
}
public string? Tabindex
public string? TabIndex
{
set
{
@@ -313,9 +301,9 @@ public readonly ref partial struct Colgroup
}
}
public Colgroup WithTabindex(string? value = null)
public Colgroup WithTabIndex(string? value = null)
{
Tabindex = value;
TabIndex = value;
return this;
}
@@ -351,36 +339,6 @@ public readonly ref partial struct Colgroup
return this;
}
public Colgroup WithCustomAttribute(string key, string? value = null)
{
WriteKey(key);
WriteValue(value);
return this;
}
public Colgroup WithCustomAttributes(scoped ReadOnlySpan<(string, string?)> attributes)
{
foreach ((string key, string? value) in attributes)
{
WriteKey(key);
WriteValue(value);
}
return this;
}
private void WriteKey(string key)
{
writer.Write(' ');
writer.Write(key);
}
private void WriteValue(string? value)
{
writer.Write("=\"");
writer.Write(value);
writer.Write('"');
}
public void Close() => writer.Write($"></{ElementName}>");
/// <summary>
@@ -401,4 +359,34 @@ public readonly ref partial struct Colgroup
writer.Write('>');
return new HtmlElementCloser(writer, $"</{ElementName}>");
}
// IHtmlElement<TSelf> implementation
TextWriter IHtmlElement<Colgroup>.Writer => writer;
static Colgroup IHtmlElement<Colgroup>.Create(TextWriter writer) => new(writer);
static bool IHtmlElement<Colgroup>.IsVoidElement => false;
static string IHtmlElement<Colgroup>.Name => ElementName;
static ReadOnlySpan<string> IHtmlElement<Colgroup>.SupportedAttributes => _supportedAttributes;
private static readonly string[] _supportedAttributes =
[
"accesskey",
"align",
"autocapitalize",
"bgcolor",
"class",
"contenteditable",
"dir",
"draggable",
"hidden",
"id",
"itemprop",
"lang",
"role",
"slot",
"span",
"spellcheck",
"style",
"tabindex",
"title",
"translate",
];
}
+44 -62
View File
@@ -4,7 +4,8 @@
namespace AssetRipper.Text.Html;
public readonly ref partial struct Content
public readonly ref partial struct Content : IHtmlElement<Content>,
IGlobalAttributes<Content>
{
private const string ElementName = "content";
private readonly TextWriter writer;
@@ -15,7 +16,7 @@ public readonly ref partial struct Content
writer.Write($"<{ElementName}");
}
public string? Accesskey
public string? AccessKey
{
set
{
@@ -25,9 +26,9 @@ public readonly ref partial struct Content
}
}
public Content WithAccesskey(string? value = null)
public Content WithAccessKey(string? value = null)
{
Accesskey = value;
AccessKey = value;
return this;
}
@@ -63,7 +64,7 @@ public readonly ref partial struct Content
return this;
}
public string? Contenteditable
public string? ContentEditable
{
set
{
@@ -73,25 +74,9 @@ public readonly ref partial struct Content
}
}
public Content WithContenteditable(string? value = null)
public Content WithContentEditable(string? value = null)
{
Contenteditable = value;
return this;
}
public string? Contextmenu
{
set
{
writer.Write(" contextmenu=\"");
writer.Write(value);
writer.Write('"');
}
}
public Content WithContextmenu(string? value = null)
{
Contextmenu = value;
ContentEditable = value;
return this;
}
@@ -159,7 +144,7 @@ public readonly ref partial struct Content
return this;
}
public string? Itemprop
public string? ItemProp
{
set
{
@@ -169,9 +154,9 @@ public readonly ref partial struct Content
}
}
public Content WithItemprop(string? value = null)
public Content WithItemProp(string? value = null)
{
Itemprop = value;
ItemProp = value;
return this;
}
@@ -223,7 +208,7 @@ public readonly ref partial struct Content
return this;
}
public string? Spellcheck
public string? SpellCheck
{
set
{
@@ -233,9 +218,9 @@ public readonly ref partial struct Content
}
}
public Content WithSpellcheck(string? value = null)
public Content WithSpellCheck(string? value = null)
{
Spellcheck = value;
SpellCheck = value;
return this;
}
@@ -255,7 +240,7 @@ public readonly ref partial struct Content
return this;
}
public string? Tabindex
public string? TabIndex
{
set
{
@@ -265,9 +250,9 @@ public readonly ref partial struct Content
}
}
public Content WithTabindex(string? value = null)
public Content WithTabIndex(string? value = null)
{
Tabindex = value;
TabIndex = value;
return this;
}
@@ -303,36 +288,6 @@ public readonly ref partial struct Content
return this;
}
public Content WithCustomAttribute(string key, string? value = null)
{
WriteKey(key);
WriteValue(value);
return this;
}
public Content WithCustomAttributes(scoped ReadOnlySpan<(string, string?)> attributes)
{
foreach ((string key, string? value) in attributes)
{
WriteKey(key);
WriteValue(value);
}
return this;
}
private void WriteKey(string key)
{
writer.Write(' ');
writer.Write(key);
}
private void WriteValue(string? value)
{
writer.Write("=\"");
writer.Write(value);
writer.Write('"');
}
public void Close() => writer.Write($"></{ElementName}>");
/// <summary>
@@ -353,4 +308,31 @@ public readonly ref partial struct Content
writer.Write('>');
return new HtmlElementCloser(writer, $"</{ElementName}>");
}
// IHtmlElement<TSelf> implementation
TextWriter IHtmlElement<Content>.Writer => writer;
static Content IHtmlElement<Content>.Create(TextWriter writer) => new(writer);
static bool IHtmlElement<Content>.IsVoidElement => false;
static string IHtmlElement<Content>.Name => ElementName;
static ReadOnlySpan<string> IHtmlElement<Content>.SupportedAttributes => _supportedAttributes;
private static readonly string[] _supportedAttributes =
[
"accesskey",
"autocapitalize",
"class",
"contenteditable",
"dir",
"draggable",
"hidden",
"id",
"itemprop",
"lang",
"role",
"slot",
"spellcheck",
"style",
"tabindex",
"title",
"translate",
];
}
+46 -62
View File
@@ -4,7 +4,9 @@
namespace AssetRipper.Text.Html;
public readonly ref partial struct Data
public readonly ref partial struct Data : IHtmlElement<Data>,
IValueAttribute<Data>,
IGlobalAttributes<Data>
{
private const string ElementName = "data";
private readonly TextWriter writer;
@@ -15,7 +17,7 @@ public readonly ref partial struct Data
writer.Write($"<{ElementName}");
}
public string? Accesskey
public string? AccessKey
{
set
{
@@ -25,9 +27,9 @@ public readonly ref partial struct Data
}
}
public Data WithAccesskey(string? value = null)
public Data WithAccessKey(string? value = null)
{
Accesskey = value;
AccessKey = value;
return this;
}
@@ -63,7 +65,7 @@ public readonly ref partial struct Data
return this;
}
public string? Contenteditable
public string? ContentEditable
{
set
{
@@ -73,25 +75,9 @@ public readonly ref partial struct Data
}
}
public Data WithContenteditable(string? value = null)
public Data WithContentEditable(string? value = null)
{
Contenteditable = value;
return this;
}
public string? Contextmenu
{
set
{
writer.Write(" contextmenu=\"");
writer.Write(value);
writer.Write('"');
}
}
public Data WithContextmenu(string? value = null)
{
Contextmenu = value;
ContentEditable = value;
return this;
}
@@ -159,7 +145,7 @@ public readonly ref partial struct Data
return this;
}
public string? Itemprop
public string? ItemProp
{
set
{
@@ -169,9 +155,9 @@ public readonly ref partial struct Data
}
}
public Data WithItemprop(string? value = null)
public Data WithItemProp(string? value = null)
{
Itemprop = value;
ItemProp = value;
return this;
}
@@ -223,7 +209,7 @@ public readonly ref partial struct Data
return this;
}
public string? Spellcheck
public string? SpellCheck
{
set
{
@@ -233,9 +219,9 @@ public readonly ref partial struct Data
}
}
public Data WithSpellcheck(string? value = null)
public Data WithSpellCheck(string? value = null)
{
Spellcheck = value;
SpellCheck = value;
return this;
}
@@ -255,7 +241,7 @@ public readonly ref partial struct Data
return this;
}
public string? Tabindex
public string? TabIndex
{
set
{
@@ -265,9 +251,9 @@ public readonly ref partial struct Data
}
}
public Data WithTabindex(string? value = null)
public Data WithTabIndex(string? value = null)
{
Tabindex = value;
TabIndex = value;
return this;
}
@@ -319,36 +305,6 @@ public readonly ref partial struct Data
return this;
}
public Data WithCustomAttribute(string key, string? value = null)
{
WriteKey(key);
WriteValue(value);
return this;
}
public Data WithCustomAttributes(scoped ReadOnlySpan<(string, string?)> attributes)
{
foreach ((string key, string? value) in attributes)
{
WriteKey(key);
WriteValue(value);
}
return this;
}
private void WriteKey(string key)
{
writer.Write(' ');
writer.Write(key);
}
private void WriteValue(string? value)
{
writer.Write("=\"");
writer.Write(value);
writer.Write('"');
}
public void Close() => writer.Write($"></{ElementName}>");
/// <summary>
@@ -369,4 +325,32 @@ public readonly ref partial struct Data
writer.Write('>');
return new HtmlElementCloser(writer, $"</{ElementName}>");
}
// IHtmlElement<TSelf> implementation
TextWriter IHtmlElement<Data>.Writer => writer;
static Data IHtmlElement<Data>.Create(TextWriter writer) => new(writer);
static bool IHtmlElement<Data>.IsVoidElement => false;
static string IHtmlElement<Data>.Name => ElementName;
static ReadOnlySpan<string> IHtmlElement<Data>.SupportedAttributes => _supportedAttributes;
private static readonly string[] _supportedAttributes =
[
"accesskey",
"autocapitalize",
"class",
"contenteditable",
"dir",
"draggable",
"hidden",
"id",
"itemprop",
"lang",
"role",
"slot",
"spellcheck",
"style",
"tabindex",
"title",
"translate",
"value",
];
}
+44 -62
View File
@@ -4,7 +4,8 @@
namespace AssetRipper.Text.Html;
public readonly ref partial struct Datalist
public readonly ref partial struct Datalist : IHtmlElement<Datalist>,
IGlobalAttributes<Datalist>
{
private const string ElementName = "datalist";
private readonly TextWriter writer;
@@ -15,7 +16,7 @@ public readonly ref partial struct Datalist
writer.Write($"<{ElementName}");
}
public string? Accesskey
public string? AccessKey
{
set
{
@@ -25,9 +26,9 @@ public readonly ref partial struct Datalist
}
}
public Datalist WithAccesskey(string? value = null)
public Datalist WithAccessKey(string? value = null)
{
Accesskey = value;
AccessKey = value;
return this;
}
@@ -63,7 +64,7 @@ public readonly ref partial struct Datalist
return this;
}
public string? Contenteditable
public string? ContentEditable
{
set
{
@@ -73,25 +74,9 @@ public readonly ref partial struct Datalist
}
}
public Datalist WithContenteditable(string? value = null)
public Datalist WithContentEditable(string? value = null)
{
Contenteditable = value;
return this;
}
public string? Contextmenu
{
set
{
writer.Write(" contextmenu=\"");
writer.Write(value);
writer.Write('"');
}
}
public Datalist WithContextmenu(string? value = null)
{
Contextmenu = value;
ContentEditable = value;
return this;
}
@@ -159,7 +144,7 @@ public readonly ref partial struct Datalist
return this;
}
public string? Itemprop
public string? ItemProp
{
set
{
@@ -169,9 +154,9 @@ public readonly ref partial struct Datalist
}
}
public Datalist WithItemprop(string? value = null)
public Datalist WithItemProp(string? value = null)
{
Itemprop = value;
ItemProp = value;
return this;
}
@@ -223,7 +208,7 @@ public readonly ref partial struct Datalist
return this;
}
public string? Spellcheck
public string? SpellCheck
{
set
{
@@ -233,9 +218,9 @@ public readonly ref partial struct Datalist
}
}
public Datalist WithSpellcheck(string? value = null)
public Datalist WithSpellCheck(string? value = null)
{
Spellcheck = value;
SpellCheck = value;
return this;
}
@@ -255,7 +240,7 @@ public readonly ref partial struct Datalist
return this;
}
public string? Tabindex
public string? TabIndex
{
set
{
@@ -265,9 +250,9 @@ public readonly ref partial struct Datalist
}
}
public Datalist WithTabindex(string? value = null)
public Datalist WithTabIndex(string? value = null)
{
Tabindex = value;
TabIndex = value;
return this;
}
@@ -303,36 +288,6 @@ public readonly ref partial struct Datalist
return this;
}
public Datalist WithCustomAttribute(string key, string? value = null)
{
WriteKey(key);
WriteValue(value);
return this;
}
public Datalist WithCustomAttributes(scoped ReadOnlySpan<(string, string?)> attributes)
{
foreach ((string key, string? value) in attributes)
{
WriteKey(key);
WriteValue(value);
}
return this;
}
private void WriteKey(string key)
{
writer.Write(' ');
writer.Write(key);
}
private void WriteValue(string? value)
{
writer.Write("=\"");
writer.Write(value);
writer.Write('"');
}
public void Close() => writer.Write($"></{ElementName}>");
/// <summary>
@@ -353,4 +308,31 @@ public readonly ref partial struct Datalist
writer.Write('>');
return new HtmlElementCloser(writer, $"</{ElementName}>");
}
// IHtmlElement<TSelf> implementation
TextWriter IHtmlElement<Datalist>.Writer => writer;
static Datalist IHtmlElement<Datalist>.Create(TextWriter writer) => new(writer);
static bool IHtmlElement<Datalist>.IsVoidElement => false;
static string IHtmlElement<Datalist>.Name => ElementName;
static ReadOnlySpan<string> IHtmlElement<Datalist>.SupportedAttributes => _supportedAttributes;
private static readonly string[] _supportedAttributes =
[
"accesskey",
"autocapitalize",
"class",
"contenteditable",
"dir",
"draggable",
"hidden",
"id",
"itemprop",
"lang",
"role",
"slot",
"spellcheck",
"style",
"tabindex",
"title",
"translate",
];
}
+44 -62
View File
@@ -4,7 +4,8 @@
namespace AssetRipper.Text.Html;
public readonly ref partial struct Dd
public readonly ref partial struct Dd : IHtmlElement<Dd>,
IGlobalAttributes<Dd>
{
private const string ElementName = "dd";
private readonly TextWriter writer;
@@ -15,7 +16,7 @@ public readonly ref partial struct Dd
writer.Write($"<{ElementName}");
}
public string? Accesskey
public string? AccessKey
{
set
{
@@ -25,9 +26,9 @@ public readonly ref partial struct Dd
}
}
public Dd WithAccesskey(string? value = null)
public Dd WithAccessKey(string? value = null)
{
Accesskey = value;
AccessKey = value;
return this;
}
@@ -63,7 +64,7 @@ public readonly ref partial struct Dd
return this;
}
public string? Contenteditable
public string? ContentEditable
{
set
{
@@ -73,25 +74,9 @@ public readonly ref partial struct Dd
}
}
public Dd WithContenteditable(string? value = null)
public Dd WithContentEditable(string? value = null)
{
Contenteditable = value;
return this;
}
public string? Contextmenu
{
set
{
writer.Write(" contextmenu=\"");
writer.Write(value);
writer.Write('"');
}
}
public Dd WithContextmenu(string? value = null)
{
Contextmenu = value;
ContentEditable = value;
return this;
}
@@ -159,7 +144,7 @@ public readonly ref partial struct Dd
return this;
}
public string? Itemprop
public string? ItemProp
{
set
{
@@ -169,9 +154,9 @@ public readonly ref partial struct Dd
}
}
public Dd WithItemprop(string? value = null)
public Dd WithItemProp(string? value = null)
{
Itemprop = value;
ItemProp = value;
return this;
}
@@ -223,7 +208,7 @@ public readonly ref partial struct Dd
return this;
}
public string? Spellcheck
public string? SpellCheck
{
set
{
@@ -233,9 +218,9 @@ public readonly ref partial struct Dd
}
}
public Dd WithSpellcheck(string? value = null)
public Dd WithSpellCheck(string? value = null)
{
Spellcheck = value;
SpellCheck = value;
return this;
}
@@ -255,7 +240,7 @@ public readonly ref partial struct Dd
return this;
}
public string? Tabindex
public string? TabIndex
{
set
{
@@ -265,9 +250,9 @@ public readonly ref partial struct Dd
}
}
public Dd WithTabindex(string? value = null)
public Dd WithTabIndex(string? value = null)
{
Tabindex = value;
TabIndex = value;
return this;
}
@@ -303,36 +288,6 @@ public readonly ref partial struct Dd
return this;
}
public Dd WithCustomAttribute(string key, string? value = null)
{
WriteKey(key);
WriteValue(value);
return this;
}
public Dd WithCustomAttributes(scoped ReadOnlySpan<(string, string?)> attributes)
{
foreach ((string key, string? value) in attributes)
{
WriteKey(key);
WriteValue(value);
}
return this;
}
private void WriteKey(string key)
{
writer.Write(' ');
writer.Write(key);
}
private void WriteValue(string? value)
{
writer.Write("=\"");
writer.Write(value);
writer.Write('"');
}
public void Close() => writer.Write($"></{ElementName}>");
/// <summary>
@@ -353,4 +308,31 @@ public readonly ref partial struct Dd
writer.Write('>');
return new HtmlElementCloser(writer, $"</{ElementName}>");
}
// IHtmlElement<TSelf> implementation
TextWriter IHtmlElement<Dd>.Writer => writer;
static Dd IHtmlElement<Dd>.Create(TextWriter writer) => new(writer);
static bool IHtmlElement<Dd>.IsVoidElement => false;
static string IHtmlElement<Dd>.Name => ElementName;
static ReadOnlySpan<string> IHtmlElement<Dd>.SupportedAttributes => _supportedAttributes;
private static readonly string[] _supportedAttributes =
[
"accesskey",
"autocapitalize",
"class",
"contenteditable",
"dir",
"draggable",
"hidden",
"id",
"itemprop",
"lang",
"role",
"slot",
"spellcheck",
"style",
"tabindex",
"title",
"translate",
];
}
+51 -65
View File
@@ -4,7 +4,10 @@
namespace AssetRipper.Text.Html;
public readonly ref partial struct Del
public readonly ref partial struct Del : IHtmlElement<Del>,
ICiteAttribute<Del>,
IDateTimeAttribute<Del>,
IGlobalAttributes<Del>
{
private const string ElementName = "del";
private readonly TextWriter writer;
@@ -15,7 +18,7 @@ public readonly ref partial struct Del
writer.Write($"<{ElementName}");
}
public string? Accesskey
public string? AccessKey
{
set
{
@@ -25,9 +28,9 @@ public readonly ref partial struct Del
}
}
public Del WithAccesskey(string? value = null)
public Del WithAccessKey(string? value = null)
{
Accesskey = value;
AccessKey = value;
return this;
}
@@ -79,7 +82,7 @@ public readonly ref partial struct Del
return this;
}
public string? Contenteditable
public string? ContentEditable
{
set
{
@@ -89,29 +92,13 @@ public readonly ref partial struct Del
}
}
public Del WithContenteditable(string? value = null)
public Del WithContentEditable(string? value = null)
{
Contenteditable = value;
ContentEditable = value;
return this;
}
public string? Contextmenu
{
set
{
writer.Write(" contextmenu=\"");
writer.Write(value);
writer.Write('"');
}
}
public Del WithContextmenu(string? value = null)
{
Contextmenu = value;
return this;
}
public string? Datetime
public string? DateTime
{
set
{
@@ -121,9 +108,9 @@ public readonly ref partial struct Del
}
}
public Del WithDatetime(string? value = null)
public Del WithDateTime(string? value = null)
{
Datetime = value;
DateTime = value;
return this;
}
@@ -191,7 +178,7 @@ public readonly ref partial struct Del
return this;
}
public string? Itemprop
public string? ItemProp
{
set
{
@@ -201,9 +188,9 @@ public readonly ref partial struct Del
}
}
public Del WithItemprop(string? value = null)
public Del WithItemProp(string? value = null)
{
Itemprop = value;
ItemProp = value;
return this;
}
@@ -255,7 +242,7 @@ public readonly ref partial struct Del
return this;
}
public string? Spellcheck
public string? SpellCheck
{
set
{
@@ -265,9 +252,9 @@ public readonly ref partial struct Del
}
}
public Del WithSpellcheck(string? value = null)
public Del WithSpellCheck(string? value = null)
{
Spellcheck = value;
SpellCheck = value;
return this;
}
@@ -287,7 +274,7 @@ public readonly ref partial struct Del
return this;
}
public string? Tabindex
public string? TabIndex
{
set
{
@@ -297,9 +284,9 @@ public readonly ref partial struct Del
}
}
public Del WithTabindex(string? value = null)
public Del WithTabIndex(string? value = null)
{
Tabindex = value;
TabIndex = value;
return this;
}
@@ -335,36 +322,6 @@ public readonly ref partial struct Del
return this;
}
public Del WithCustomAttribute(string key, string? value = null)
{
WriteKey(key);
WriteValue(value);
return this;
}
public Del WithCustomAttributes(scoped ReadOnlySpan<(string, string?)> attributes)
{
foreach ((string key, string? value) in attributes)
{
WriteKey(key);
WriteValue(value);
}
return this;
}
private void WriteKey(string key)
{
writer.Write(' ');
writer.Write(key);
}
private void WriteValue(string? value)
{
writer.Write("=\"");
writer.Write(value);
writer.Write('"');
}
public void Close() => writer.Write($"></{ElementName}>");
/// <summary>
@@ -385,4 +342,33 @@ public readonly ref partial struct Del
writer.Write('>');
return new HtmlElementCloser(writer, $"</{ElementName}>");
}
// IHtmlElement<TSelf> implementation
TextWriter IHtmlElement<Del>.Writer => writer;
static Del IHtmlElement<Del>.Create(TextWriter writer) => new(writer);
static bool IHtmlElement<Del>.IsVoidElement => false;
static string IHtmlElement<Del>.Name => ElementName;
static ReadOnlySpan<string> IHtmlElement<Del>.SupportedAttributes => _supportedAttributes;
private static readonly string[] _supportedAttributes =
[
"accesskey",
"autocapitalize",
"cite",
"class",
"contenteditable",
"datetime",
"dir",
"draggable",
"hidden",
"id",
"itemprop",
"lang",
"role",
"slot",
"spellcheck",
"style",
"tabindex",
"title",
"translate",
];
}
+46 -62
View File
@@ -4,7 +4,9 @@
namespace AssetRipper.Text.Html;
public readonly ref partial struct Details
public readonly ref partial struct Details : IHtmlElement<Details>,
IOpenAttribute<Details>,
IGlobalAttributes<Details>
{
private const string ElementName = "details";
private readonly TextWriter writer;
@@ -15,7 +17,7 @@ public readonly ref partial struct Details
writer.Write($"<{ElementName}");
}
public string? Accesskey
public string? AccessKey
{
set
{
@@ -25,9 +27,9 @@ public readonly ref partial struct Details
}
}
public Details WithAccesskey(string? value = null)
public Details WithAccessKey(string? value = null)
{
Accesskey = value;
AccessKey = value;
return this;
}
@@ -63,7 +65,7 @@ public readonly ref partial struct Details
return this;
}
public string? Contenteditable
public string? ContentEditable
{
set
{
@@ -73,25 +75,9 @@ public readonly ref partial struct Details
}
}
public Details WithContenteditable(string? value = null)
public Details WithContentEditable(string? value = null)
{
Contenteditable = value;
return this;
}
public string? Contextmenu
{
set
{
writer.Write(" contextmenu=\"");
writer.Write(value);
writer.Write('"');
}
}
public Details WithContextmenu(string? value = null)
{
Contextmenu = value;
ContentEditable = value;
return this;
}
@@ -159,7 +145,7 @@ public readonly ref partial struct Details
return this;
}
public string? Itemprop
public string? ItemProp
{
set
{
@@ -169,9 +155,9 @@ public readonly ref partial struct Details
}
}
public Details WithItemprop(string? value = null)
public Details WithItemProp(string? value = null)
{
Itemprop = value;
ItemProp = value;
return this;
}
@@ -239,7 +225,7 @@ public readonly ref partial struct Details
return this;
}
public string? Spellcheck
public string? SpellCheck
{
set
{
@@ -249,9 +235,9 @@ public readonly ref partial struct Details
}
}
public Details WithSpellcheck(string? value = null)
public Details WithSpellCheck(string? value = null)
{
Spellcheck = value;
SpellCheck = value;
return this;
}
@@ -271,7 +257,7 @@ public readonly ref partial struct Details
return this;
}
public string? Tabindex
public string? TabIndex
{
set
{
@@ -281,9 +267,9 @@ public readonly ref partial struct Details
}
}
public Details WithTabindex(string? value = null)
public Details WithTabIndex(string? value = null)
{
Tabindex = value;
TabIndex = value;
return this;
}
@@ -319,36 +305,6 @@ public readonly ref partial struct Details
return this;
}
public Details WithCustomAttribute(string key, string? value = null)
{
WriteKey(key);
WriteValue(value);
return this;
}
public Details WithCustomAttributes(scoped ReadOnlySpan<(string, string?)> attributes)
{
foreach ((string key, string? value) in attributes)
{
WriteKey(key);
WriteValue(value);
}
return this;
}
private void WriteKey(string key)
{
writer.Write(' ');
writer.Write(key);
}
private void WriteValue(string? value)
{
writer.Write("=\"");
writer.Write(value);
writer.Write('"');
}
public void Close() => writer.Write($"></{ElementName}>");
/// <summary>
@@ -369,4 +325,32 @@ public readonly ref partial struct Details
writer.Write('>');
return new HtmlElementCloser(writer, $"</{ElementName}>");
}
// IHtmlElement<TSelf> implementation
TextWriter IHtmlElement<Details>.Writer => writer;
static Details IHtmlElement<Details>.Create(TextWriter writer) => new(writer);
static bool IHtmlElement<Details>.IsVoidElement => false;
static string IHtmlElement<Details>.Name => ElementName;
static ReadOnlySpan<string> IHtmlElement<Details>.SupportedAttributes => _supportedAttributes;
private static readonly string[] _supportedAttributes =
[
"accesskey",
"autocapitalize",
"class",
"contenteditable",
"dir",
"draggable",
"hidden",
"id",
"itemprop",
"lang",
"open",
"role",
"slot",
"spellcheck",
"style",
"tabindex",
"title",
"translate",
];
}
+44 -62
View File
@@ -4,7 +4,8 @@
namespace AssetRipper.Text.Html;
public readonly ref partial struct Dfn
public readonly ref partial struct Dfn : IHtmlElement<Dfn>,
IGlobalAttributes<Dfn>
{
private const string ElementName = "dfn";
private readonly TextWriter writer;
@@ -15,7 +16,7 @@ public readonly ref partial struct Dfn
writer.Write($"<{ElementName}");
}
public string? Accesskey
public string? AccessKey
{
set
{
@@ -25,9 +26,9 @@ public readonly ref partial struct Dfn
}
}
public Dfn WithAccesskey(string? value = null)
public Dfn WithAccessKey(string? value = null)
{
Accesskey = value;
AccessKey = value;
return this;
}
@@ -63,7 +64,7 @@ public readonly ref partial struct Dfn
return this;
}
public string? Contenteditable
public string? ContentEditable
{
set
{
@@ -73,25 +74,9 @@ public readonly ref partial struct Dfn
}
}
public Dfn WithContenteditable(string? value = null)
public Dfn WithContentEditable(string? value = null)
{
Contenteditable = value;
return this;
}
public string? Contextmenu
{
set
{
writer.Write(" contextmenu=\"");
writer.Write(value);
writer.Write('"');
}
}
public Dfn WithContextmenu(string? value = null)
{
Contextmenu = value;
ContentEditable = value;
return this;
}
@@ -159,7 +144,7 @@ public readonly ref partial struct Dfn
return this;
}
public string? Itemprop
public string? ItemProp
{
set
{
@@ -169,9 +154,9 @@ public readonly ref partial struct Dfn
}
}
public Dfn WithItemprop(string? value = null)
public Dfn WithItemProp(string? value = null)
{
Itemprop = value;
ItemProp = value;
return this;
}
@@ -223,7 +208,7 @@ public readonly ref partial struct Dfn
return this;
}
public string? Spellcheck
public string? SpellCheck
{
set
{
@@ -233,9 +218,9 @@ public readonly ref partial struct Dfn
}
}
public Dfn WithSpellcheck(string? value = null)
public Dfn WithSpellCheck(string? value = null)
{
Spellcheck = value;
SpellCheck = value;
return this;
}
@@ -255,7 +240,7 @@ public readonly ref partial struct Dfn
return this;
}
public string? Tabindex
public string? TabIndex
{
set
{
@@ -265,9 +250,9 @@ public readonly ref partial struct Dfn
}
}
public Dfn WithTabindex(string? value = null)
public Dfn WithTabIndex(string? value = null)
{
Tabindex = value;
TabIndex = value;
return this;
}
@@ -303,36 +288,6 @@ public readonly ref partial struct Dfn
return this;
}
public Dfn WithCustomAttribute(string key, string? value = null)
{
WriteKey(key);
WriteValue(value);
return this;
}
public Dfn WithCustomAttributes(scoped ReadOnlySpan<(string, string?)> attributes)
{
foreach ((string key, string? value) in attributes)
{
WriteKey(key);
WriteValue(value);
}
return this;
}
private void WriteKey(string key)
{
writer.Write(' ');
writer.Write(key);
}
private void WriteValue(string? value)
{
writer.Write("=\"");
writer.Write(value);
writer.Write('"');
}
public void Close() => writer.Write($"></{ElementName}>");
/// <summary>
@@ -353,4 +308,31 @@ public readonly ref partial struct Dfn
writer.Write('>');
return new HtmlElementCloser(writer, $"</{ElementName}>");
}
// IHtmlElement<TSelf> implementation
TextWriter IHtmlElement<Dfn>.Writer => writer;
static Dfn IHtmlElement<Dfn>.Create(TextWriter writer) => new(writer);
static bool IHtmlElement<Dfn>.IsVoidElement => false;
static string IHtmlElement<Dfn>.Name => ElementName;
static ReadOnlySpan<string> IHtmlElement<Dfn>.SupportedAttributes => _supportedAttributes;
private static readonly string[] _supportedAttributes =
[
"accesskey",
"autocapitalize",
"class",
"contenteditable",
"dir",
"draggable",
"hidden",
"id",
"itemprop",
"lang",
"role",
"slot",
"spellcheck",
"style",
"tabindex",
"title",
"translate",
];
}
+46 -62
View File
@@ -4,7 +4,9 @@
namespace AssetRipper.Text.Html;
public readonly ref partial struct Dialog
public readonly ref partial struct Dialog : IHtmlElement<Dialog>,
IOpenAttribute<Dialog>,
IGlobalAttributes<Dialog>
{
private const string ElementName = "dialog";
private readonly TextWriter writer;
@@ -15,7 +17,7 @@ public readonly ref partial struct Dialog
writer.Write($"<{ElementName}");
}
public string? Accesskey
public string? AccessKey
{
set
{
@@ -25,9 +27,9 @@ public readonly ref partial struct Dialog
}
}
public Dialog WithAccesskey(string? value = null)
public Dialog WithAccessKey(string? value = null)
{
Accesskey = value;
AccessKey = value;
return this;
}
@@ -63,7 +65,7 @@ public readonly ref partial struct Dialog
return this;
}
public string? Contenteditable
public string? ContentEditable
{
set
{
@@ -73,25 +75,9 @@ public readonly ref partial struct Dialog
}
}
public Dialog WithContenteditable(string? value = null)
public Dialog WithContentEditable(string? value = null)
{
Contenteditable = value;
return this;
}
public string? Contextmenu
{
set
{
writer.Write(" contextmenu=\"");
writer.Write(value);
writer.Write('"');
}
}
public Dialog WithContextmenu(string? value = null)
{
Contextmenu = value;
ContentEditable = value;
return this;
}
@@ -159,7 +145,7 @@ public readonly ref partial struct Dialog
return this;
}
public string? Itemprop
public string? ItemProp
{
set
{
@@ -169,9 +155,9 @@ public readonly ref partial struct Dialog
}
}
public Dialog WithItemprop(string? value = null)
public Dialog WithItemProp(string? value = null)
{
Itemprop = value;
ItemProp = value;
return this;
}
@@ -239,7 +225,7 @@ public readonly ref partial struct Dialog
return this;
}
public string? Spellcheck
public string? SpellCheck
{
set
{
@@ -249,9 +235,9 @@ public readonly ref partial struct Dialog
}
}
public Dialog WithSpellcheck(string? value = null)
public Dialog WithSpellCheck(string? value = null)
{
Spellcheck = value;
SpellCheck = value;
return this;
}
@@ -271,7 +257,7 @@ public readonly ref partial struct Dialog
return this;
}
public string? Tabindex
public string? TabIndex
{
set
{
@@ -281,9 +267,9 @@ public readonly ref partial struct Dialog
}
}
public Dialog WithTabindex(string? value = null)
public Dialog WithTabIndex(string? value = null)
{
Tabindex = value;
TabIndex = value;
return this;
}
@@ -319,36 +305,6 @@ public readonly ref partial struct Dialog
return this;
}
public Dialog WithCustomAttribute(string key, string? value = null)
{
WriteKey(key);
WriteValue(value);
return this;
}
public Dialog WithCustomAttributes(scoped ReadOnlySpan<(string, string?)> attributes)
{
foreach ((string key, string? value) in attributes)
{
WriteKey(key);
WriteValue(value);
}
return this;
}
private void WriteKey(string key)
{
writer.Write(' ');
writer.Write(key);
}
private void WriteValue(string? value)
{
writer.Write("=\"");
writer.Write(value);
writer.Write('"');
}
public void Close() => writer.Write($"></{ElementName}>");
/// <summary>
@@ -369,4 +325,32 @@ public readonly ref partial struct Dialog
writer.Write('>');
return new HtmlElementCloser(writer, $"</{ElementName}>");
}
// IHtmlElement<TSelf> implementation
TextWriter IHtmlElement<Dialog>.Writer => writer;
static Dialog IHtmlElement<Dialog>.Create(TextWriter writer) => new(writer);
static bool IHtmlElement<Dialog>.IsVoidElement => false;
static string IHtmlElement<Dialog>.Name => ElementName;
static ReadOnlySpan<string> IHtmlElement<Dialog>.SupportedAttributes => _supportedAttributes;
private static readonly string[] _supportedAttributes =
[
"accesskey",
"autocapitalize",
"class",
"contenteditable",
"dir",
"draggable",
"hidden",
"id",
"itemprop",
"lang",
"open",
"role",
"slot",
"spellcheck",
"style",
"tabindex",
"title",
"translate",
];
}
+49 -62
View File
@@ -4,7 +4,8 @@
namespace AssetRipper.Text.Html;
public readonly ref partial struct Dir
public readonly ref partial struct Dir : IHtmlElement<Dir>,
IGlobalAttributes<Dir>
{
private const string ElementName = "dir";
private readonly TextWriter writer;
@@ -15,7 +16,7 @@ public readonly ref partial struct Dir
writer.Write($"<{ElementName}");
}
public string? Accesskey
public string? AccessKey
{
set
{
@@ -25,9 +26,9 @@ public readonly ref partial struct Dir
}
}
public Dir WithAccesskey(string? value = null)
public Dir WithAccessKey(string? value = null)
{
Accesskey = value;
AccessKey = value;
return this;
}
@@ -63,7 +64,7 @@ public readonly ref partial struct Dir
return this;
}
public string? Contenteditable
public string? ContentEditable
{
set
{
@@ -73,25 +74,9 @@ public readonly ref partial struct Dir
}
}
public Dir WithContenteditable(string? value = null)
public Dir WithContentEditable(string? value = null)
{
Contenteditable = value;
return this;
}
public string? Contextmenu
{
set
{
writer.Write(" contextmenu=\"");
writer.Write(value);
writer.Write('"');
}
}
public Dir WithContextmenu(string? value = null)
{
Contextmenu = value;
ContentEditable = value;
return this;
}
@@ -105,6 +90,11 @@ public readonly ref partial struct Dir
}
}
string IGlobalAttributes<Dir>.Dir
{
set => Dir_ = value;
}
public Dir WithDir(string? value = null)
{
Dir_ = value;
@@ -159,7 +149,7 @@ public readonly ref partial struct Dir
return this;
}
public string? Itemprop
public string? ItemProp
{
set
{
@@ -169,9 +159,9 @@ public readonly ref partial struct Dir
}
}
public Dir WithItemprop(string? value = null)
public Dir WithItemProp(string? value = null)
{
Itemprop = value;
ItemProp = value;
return this;
}
@@ -223,7 +213,7 @@ public readonly ref partial struct Dir
return this;
}
public string? Spellcheck
public string? SpellCheck
{
set
{
@@ -233,9 +223,9 @@ public readonly ref partial struct Dir
}
}
public Dir WithSpellcheck(string? value = null)
public Dir WithSpellCheck(string? value = null)
{
Spellcheck = value;
SpellCheck = value;
return this;
}
@@ -255,7 +245,7 @@ public readonly ref partial struct Dir
return this;
}
public string? Tabindex
public string? TabIndex
{
set
{
@@ -265,9 +255,9 @@ public readonly ref partial struct Dir
}
}
public Dir WithTabindex(string? value = null)
public Dir WithTabIndex(string? value = null)
{
Tabindex = value;
TabIndex = value;
return this;
}
@@ -303,36 +293,6 @@ public readonly ref partial struct Dir
return this;
}
public Dir WithCustomAttribute(string key, string? value = null)
{
WriteKey(key);
WriteValue(value);
return this;
}
public Dir WithCustomAttributes(scoped ReadOnlySpan<(string, string?)> attributes)
{
foreach ((string key, string? value) in attributes)
{
WriteKey(key);
WriteValue(value);
}
return this;
}
private void WriteKey(string key)
{
writer.Write(' ');
writer.Write(key);
}
private void WriteValue(string? value)
{
writer.Write("=\"");
writer.Write(value);
writer.Write('"');
}
public void Close() => writer.Write($"></{ElementName}>");
/// <summary>
@@ -353,4 +313,31 @@ public readonly ref partial struct Dir
writer.Write('>');
return new HtmlElementCloser(writer, $"</{ElementName}>");
}
// IHtmlElement<TSelf> implementation
TextWriter IHtmlElement<Dir>.Writer => writer;
static Dir IHtmlElement<Dir>.Create(TextWriter writer) => new(writer);
static bool IHtmlElement<Dir>.IsVoidElement => false;
static string IHtmlElement<Dir>.Name => ElementName;
static ReadOnlySpan<string> IHtmlElement<Dir>.SupportedAttributes => _supportedAttributes;
private static readonly string[] _supportedAttributes =
[
"accesskey",
"autocapitalize",
"class",
"contenteditable",
"dir",
"draggable",
"hidden",
"id",
"itemprop",
"lang",
"role",
"slot",
"spellcheck",
"style",
"tabindex",
"title",
"translate",
];
}
+44 -62
View File
@@ -4,7 +4,8 @@
namespace AssetRipper.Text.Html;
public readonly ref partial struct Div
public readonly ref partial struct Div : IHtmlElement<Div>,
IGlobalAttributes<Div>
{
private const string ElementName = "div";
private readonly TextWriter writer;
@@ -15,7 +16,7 @@ public readonly ref partial struct Div
writer.Write($"<{ElementName}");
}
public string? Accesskey
public string? AccessKey
{
set
{
@@ -25,9 +26,9 @@ public readonly ref partial struct Div
}
}
public Div WithAccesskey(string? value = null)
public Div WithAccessKey(string? value = null)
{
Accesskey = value;
AccessKey = value;
return this;
}
@@ -63,7 +64,7 @@ public readonly ref partial struct Div
return this;
}
public string? Contenteditable
public string? ContentEditable
{
set
{
@@ -73,25 +74,9 @@ public readonly ref partial struct Div
}
}
public Div WithContenteditable(string? value = null)
public Div WithContentEditable(string? value = null)
{
Contenteditable = value;
return this;
}
public string? Contextmenu
{
set
{
writer.Write(" contextmenu=\"");
writer.Write(value);
writer.Write('"');
}
}
public Div WithContextmenu(string? value = null)
{
Contextmenu = value;
ContentEditable = value;
return this;
}
@@ -159,7 +144,7 @@ public readonly ref partial struct Div
return this;
}
public string? Itemprop
public string? ItemProp
{
set
{
@@ -169,9 +154,9 @@ public readonly ref partial struct Div
}
}
public Div WithItemprop(string? value = null)
public Div WithItemProp(string? value = null)
{
Itemprop = value;
ItemProp = value;
return this;
}
@@ -223,7 +208,7 @@ public readonly ref partial struct Div
return this;
}
public string? Spellcheck
public string? SpellCheck
{
set
{
@@ -233,9 +218,9 @@ public readonly ref partial struct Div
}
}
public Div WithSpellcheck(string? value = null)
public Div WithSpellCheck(string? value = null)
{
Spellcheck = value;
SpellCheck = value;
return this;
}
@@ -255,7 +240,7 @@ public readonly ref partial struct Div
return this;
}
public string? Tabindex
public string? TabIndex
{
set
{
@@ -265,9 +250,9 @@ public readonly ref partial struct Div
}
}
public Div WithTabindex(string? value = null)
public Div WithTabIndex(string? value = null)
{
Tabindex = value;
TabIndex = value;
return this;
}
@@ -303,36 +288,6 @@ public readonly ref partial struct Div
return this;
}
public Div WithCustomAttribute(string key, string? value = null)
{
WriteKey(key);
WriteValue(value);
return this;
}
public Div WithCustomAttributes(scoped ReadOnlySpan<(string, string?)> attributes)
{
foreach ((string key, string? value) in attributes)
{
WriteKey(key);
WriteValue(value);
}
return this;
}
private void WriteKey(string key)
{
writer.Write(' ');
writer.Write(key);
}
private void WriteValue(string? value)
{
writer.Write("=\"");
writer.Write(value);
writer.Write('"');
}
public void Close() => writer.Write($"></{ElementName}>");
/// <summary>
@@ -353,4 +308,31 @@ public readonly ref partial struct Div
writer.Write('>');
return new HtmlElementCloser(writer, $"</{ElementName}>");
}
// IHtmlElement<TSelf> implementation
TextWriter IHtmlElement<Div>.Writer => writer;
static Div IHtmlElement<Div>.Create(TextWriter writer) => new(writer);
static bool IHtmlElement<Div>.IsVoidElement => false;
static string IHtmlElement<Div>.Name => ElementName;
static ReadOnlySpan<string> IHtmlElement<Div>.SupportedAttributes => _supportedAttributes;
private static readonly string[] _supportedAttributes =
[
"accesskey",
"autocapitalize",
"class",
"contenteditable",
"dir",
"draggable",
"hidden",
"id",
"itemprop",
"lang",
"role",
"slot",
"spellcheck",
"style",
"tabindex",
"title",
"translate",
];
}
+44 -62
View File
@@ -4,7 +4,8 @@
namespace AssetRipper.Text.Html;
public readonly ref partial struct Dl
public readonly ref partial struct Dl : IHtmlElement<Dl>,
IGlobalAttributes<Dl>
{
private const string ElementName = "dl";
private readonly TextWriter writer;
@@ -15,7 +16,7 @@ public readonly ref partial struct Dl
writer.Write($"<{ElementName}");
}
public string? Accesskey
public string? AccessKey
{
set
{
@@ -25,9 +26,9 @@ public readonly ref partial struct Dl
}
}
public Dl WithAccesskey(string? value = null)
public Dl WithAccessKey(string? value = null)
{
Accesskey = value;
AccessKey = value;
return this;
}
@@ -63,7 +64,7 @@ public readonly ref partial struct Dl
return this;
}
public string? Contenteditable
public string? ContentEditable
{
set
{
@@ -73,25 +74,9 @@ public readonly ref partial struct Dl
}
}
public Dl WithContenteditable(string? value = null)
public Dl WithContentEditable(string? value = null)
{
Contenteditable = value;
return this;
}
public string? Contextmenu
{
set
{
writer.Write(" contextmenu=\"");
writer.Write(value);
writer.Write('"');
}
}
public Dl WithContextmenu(string? value = null)
{
Contextmenu = value;
ContentEditable = value;
return this;
}
@@ -159,7 +144,7 @@ public readonly ref partial struct Dl
return this;
}
public string? Itemprop
public string? ItemProp
{
set
{
@@ -169,9 +154,9 @@ public readonly ref partial struct Dl
}
}
public Dl WithItemprop(string? value = null)
public Dl WithItemProp(string? value = null)
{
Itemprop = value;
ItemProp = value;
return this;
}
@@ -223,7 +208,7 @@ public readonly ref partial struct Dl
return this;
}
public string? Spellcheck
public string? SpellCheck
{
set
{
@@ -233,9 +218,9 @@ public readonly ref partial struct Dl
}
}
public Dl WithSpellcheck(string? value = null)
public Dl WithSpellCheck(string? value = null)
{
Spellcheck = value;
SpellCheck = value;
return this;
}
@@ -255,7 +240,7 @@ public readonly ref partial struct Dl
return this;
}
public string? Tabindex
public string? TabIndex
{
set
{
@@ -265,9 +250,9 @@ public readonly ref partial struct Dl
}
}
public Dl WithTabindex(string? value = null)
public Dl WithTabIndex(string? value = null)
{
Tabindex = value;
TabIndex = value;
return this;
}
@@ -303,36 +288,6 @@ public readonly ref partial struct Dl
return this;
}
public Dl WithCustomAttribute(string key, string? value = null)
{
WriteKey(key);
WriteValue(value);
return this;
}
public Dl WithCustomAttributes(scoped ReadOnlySpan<(string, string?)> attributes)
{
foreach ((string key, string? value) in attributes)
{
WriteKey(key);
WriteValue(value);
}
return this;
}
private void WriteKey(string key)
{
writer.Write(' ');
writer.Write(key);
}
private void WriteValue(string? value)
{
writer.Write("=\"");
writer.Write(value);
writer.Write('"');
}
public void Close() => writer.Write($"></{ElementName}>");
/// <summary>
@@ -353,4 +308,31 @@ public readonly ref partial struct Dl
writer.Write('>');
return new HtmlElementCloser(writer, $"</{ElementName}>");
}
// IHtmlElement<TSelf> implementation
TextWriter IHtmlElement<Dl>.Writer => writer;
static Dl IHtmlElement<Dl>.Create(TextWriter writer) => new(writer);
static bool IHtmlElement<Dl>.IsVoidElement => false;
static string IHtmlElement<Dl>.Name => ElementName;
static ReadOnlySpan<string> IHtmlElement<Dl>.SupportedAttributes => _supportedAttributes;
private static readonly string[] _supportedAttributes =
[
"accesskey",
"autocapitalize",
"class",
"contenteditable",
"dir",
"draggable",
"hidden",
"id",
"itemprop",
"lang",
"role",
"slot",
"spellcheck",
"style",
"tabindex",
"title",
"translate",
];
}
+44 -62
View File
@@ -4,7 +4,8 @@
namespace AssetRipper.Text.Html;
public readonly ref partial struct Dt
public readonly ref partial struct Dt : IHtmlElement<Dt>,
IGlobalAttributes<Dt>
{
private const string ElementName = "dt";
private readonly TextWriter writer;
@@ -15,7 +16,7 @@ public readonly ref partial struct Dt
writer.Write($"<{ElementName}");
}
public string? Accesskey
public string? AccessKey
{
set
{
@@ -25,9 +26,9 @@ public readonly ref partial struct Dt
}
}
public Dt WithAccesskey(string? value = null)
public Dt WithAccessKey(string? value = null)
{
Accesskey = value;
AccessKey = value;
return this;
}
@@ -63,7 +64,7 @@ public readonly ref partial struct Dt
return this;
}
public string? Contenteditable
public string? ContentEditable
{
set
{
@@ -73,25 +74,9 @@ public readonly ref partial struct Dt
}
}
public Dt WithContenteditable(string? value = null)
public Dt WithContentEditable(string? value = null)
{
Contenteditable = value;
return this;
}
public string? Contextmenu
{
set
{
writer.Write(" contextmenu=\"");
writer.Write(value);
writer.Write('"');
}
}
public Dt WithContextmenu(string? value = null)
{
Contextmenu = value;
ContentEditable = value;
return this;
}
@@ -159,7 +144,7 @@ public readonly ref partial struct Dt
return this;
}
public string? Itemprop
public string? ItemProp
{
set
{
@@ -169,9 +154,9 @@ public readonly ref partial struct Dt
}
}
public Dt WithItemprop(string? value = null)
public Dt WithItemProp(string? value = null)
{
Itemprop = value;
ItemProp = value;
return this;
}
@@ -223,7 +208,7 @@ public readonly ref partial struct Dt
return this;
}
public string? Spellcheck
public string? SpellCheck
{
set
{
@@ -233,9 +218,9 @@ public readonly ref partial struct Dt
}
}
public Dt WithSpellcheck(string? value = null)
public Dt WithSpellCheck(string? value = null)
{
Spellcheck = value;
SpellCheck = value;
return this;
}
@@ -255,7 +240,7 @@ public readonly ref partial struct Dt
return this;
}
public string? Tabindex
public string? TabIndex
{
set
{
@@ -265,9 +250,9 @@ public readonly ref partial struct Dt
}
}
public Dt WithTabindex(string? value = null)
public Dt WithTabIndex(string? value = null)
{
Tabindex = value;
TabIndex = value;
return this;
}
@@ -303,36 +288,6 @@ public readonly ref partial struct Dt
return this;
}
public Dt WithCustomAttribute(string key, string? value = null)
{
WriteKey(key);
WriteValue(value);
return this;
}
public Dt WithCustomAttributes(scoped ReadOnlySpan<(string, string?)> attributes)
{
foreach ((string key, string? value) in attributes)
{
WriteKey(key);
WriteValue(value);
}
return this;
}
private void WriteKey(string key)
{
writer.Write(' ');
writer.Write(key);
}
private void WriteValue(string? value)
{
writer.Write("=\"");
writer.Write(value);
writer.Write('"');
}
public void Close() => writer.Write($"></{ElementName}>");
/// <summary>
@@ -353,4 +308,31 @@ public readonly ref partial struct Dt
writer.Write('>');
return new HtmlElementCloser(writer, $"</{ElementName}>");
}
// IHtmlElement<TSelf> implementation
TextWriter IHtmlElement<Dt>.Writer => writer;
static Dt IHtmlElement<Dt>.Create(TextWriter writer) => new(writer);
static bool IHtmlElement<Dt>.IsVoidElement => false;
static string IHtmlElement<Dt>.Name => ElementName;
static ReadOnlySpan<string> IHtmlElement<Dt>.SupportedAttributes => _supportedAttributes;
private static readonly string[] _supportedAttributes =
[
"accesskey",
"autocapitalize",
"class",
"contenteditable",
"dir",
"draggable",
"hidden",
"id",
"itemprop",
"lang",
"role",
"slot",
"spellcheck",
"style",
"tabindex",
"title",
"translate",
];
}
+44 -62
View File
@@ -4,7 +4,8 @@
namespace AssetRipper.Text.Html;
public readonly ref partial struct Em
public readonly ref partial struct Em : IHtmlElement<Em>,
IGlobalAttributes<Em>
{
private const string ElementName = "em";
private readonly TextWriter writer;
@@ -15,7 +16,7 @@ public readonly ref partial struct Em
writer.Write($"<{ElementName}");
}
public string? Accesskey
public string? AccessKey
{
set
{
@@ -25,9 +26,9 @@ public readonly ref partial struct Em
}
}
public Em WithAccesskey(string? value = null)
public Em WithAccessKey(string? value = null)
{
Accesskey = value;
AccessKey = value;
return this;
}
@@ -63,7 +64,7 @@ public readonly ref partial struct Em
return this;
}
public string? Contenteditable
public string? ContentEditable
{
set
{
@@ -73,25 +74,9 @@ public readonly ref partial struct Em
}
}
public Em WithContenteditable(string? value = null)
public Em WithContentEditable(string? value = null)
{
Contenteditable = value;
return this;
}
public string? Contextmenu
{
set
{
writer.Write(" contextmenu=\"");
writer.Write(value);
writer.Write('"');
}
}
public Em WithContextmenu(string? value = null)
{
Contextmenu = value;
ContentEditable = value;
return this;
}
@@ -159,7 +144,7 @@ public readonly ref partial struct Em
return this;
}
public string? Itemprop
public string? ItemProp
{
set
{
@@ -169,9 +154,9 @@ public readonly ref partial struct Em
}
}
public Em WithItemprop(string? value = null)
public Em WithItemProp(string? value = null)
{
Itemprop = value;
ItemProp = value;
return this;
}
@@ -223,7 +208,7 @@ public readonly ref partial struct Em
return this;
}
public string? Spellcheck
public string? SpellCheck
{
set
{
@@ -233,9 +218,9 @@ public readonly ref partial struct Em
}
}
public Em WithSpellcheck(string? value = null)
public Em WithSpellCheck(string? value = null)
{
Spellcheck = value;
SpellCheck = value;
return this;
}
@@ -255,7 +240,7 @@ public readonly ref partial struct Em
return this;
}
public string? Tabindex
public string? TabIndex
{
set
{
@@ -265,9 +250,9 @@ public readonly ref partial struct Em
}
}
public Em WithTabindex(string? value = null)
public Em WithTabIndex(string? value = null)
{
Tabindex = value;
TabIndex = value;
return this;
}
@@ -303,36 +288,6 @@ public readonly ref partial struct Em
return this;
}
public Em WithCustomAttribute(string key, string? value = null)
{
WriteKey(key);
WriteValue(value);
return this;
}
public Em WithCustomAttributes(scoped ReadOnlySpan<(string, string?)> attributes)
{
foreach ((string key, string? value) in attributes)
{
WriteKey(key);
WriteValue(value);
}
return this;
}
private void WriteKey(string key)
{
writer.Write(' ');
writer.Write(key);
}
private void WriteValue(string? value)
{
writer.Write("=\"");
writer.Write(value);
writer.Write('"');
}
public void Close() => writer.Write($"></{ElementName}>");
/// <summary>
@@ -353,4 +308,31 @@ public readonly ref partial struct Em
writer.Write('>');
return new HtmlElementCloser(writer, $"</{ElementName}>");
}
// IHtmlElement<TSelf> implementation
TextWriter IHtmlElement<Em>.Writer => writer;
static Em IHtmlElement<Em>.Create(TextWriter writer) => new(writer);
static bool IHtmlElement<Em>.IsVoidElement => false;
static string IHtmlElement<Em>.Name => ElementName;
static ReadOnlySpan<string> IHtmlElement<Em>.SupportedAttributes => _supportedAttributes;
private static readonly string[] _supportedAttributes =
[
"accesskey",
"autocapitalize",
"class",
"contenteditable",
"dir",
"draggable",
"hidden",
"id",
"itemprop",
"lang",
"role",
"slot",
"spellcheck",
"style",
"tabindex",
"title",
"translate",
];
}
+54 -62
View File
@@ -4,7 +4,12 @@
namespace AssetRipper.Text.Html;
public readonly ref partial struct Embed
public readonly ref partial struct Embed : IHtmlElement<Embed>,
IHeightAttribute<Embed>,
ISrcAttribute<Embed>,
ITypeAttribute<Embed>,
IWidthAttribute<Embed>,
IGlobalAttributes<Embed>
{
private const string ElementName = "embed";
private readonly TextWriter writer;
@@ -15,7 +20,7 @@ public readonly ref partial struct Embed
writer.Write($"<{ElementName}");
}
public string? Accesskey
public string? AccessKey
{
set
{
@@ -25,9 +30,9 @@ public readonly ref partial struct Embed
}
}
public Embed WithAccesskey(string? value = null)
public Embed WithAccessKey(string? value = null)
{
Accesskey = value;
AccessKey = value;
return this;
}
@@ -63,7 +68,7 @@ public readonly ref partial struct Embed
return this;
}
public string? Contenteditable
public string? ContentEditable
{
set
{
@@ -73,25 +78,9 @@ public readonly ref partial struct Embed
}
}
public Embed WithContenteditable(string? value = null)
public Embed WithContentEditable(string? value = null)
{
Contenteditable = value;
return this;
}
public string? Contextmenu
{
set
{
writer.Write(" contextmenu=\"");
writer.Write(value);
writer.Write('"');
}
}
public Embed WithContextmenu(string? value = null)
{
Contextmenu = value;
ContentEditable = value;
return this;
}
@@ -175,7 +164,7 @@ public readonly ref partial struct Embed
return this;
}
public string? Itemprop
public string? ItemProp
{
set
{
@@ -185,9 +174,9 @@ public readonly ref partial struct Embed
}
}
public Embed WithItemprop(string? value = null)
public Embed WithItemProp(string? value = null)
{
Itemprop = value;
ItemProp = value;
return this;
}
@@ -239,7 +228,7 @@ public readonly ref partial struct Embed
return this;
}
public string? Spellcheck
public string? SpellCheck
{
set
{
@@ -249,9 +238,9 @@ public readonly ref partial struct Embed
}
}
public Embed WithSpellcheck(string? value = null)
public Embed WithSpellCheck(string? value = null)
{
Spellcheck = value;
SpellCheck = value;
return this;
}
@@ -287,7 +276,7 @@ public readonly ref partial struct Embed
return this;
}
public string? Tabindex
public string? TabIndex
{
set
{
@@ -297,9 +286,9 @@ public readonly ref partial struct Embed
}
}
public Embed WithTabindex(string? value = null)
public Embed WithTabIndex(string? value = null)
{
Tabindex = value;
TabIndex = value;
return this;
}
@@ -367,35 +356,38 @@ public readonly ref partial struct Embed
return this;
}
public Embed WithCustomAttribute(string key, string? value = null)
{
WriteKey(key);
WriteValue(value);
return this;
}
public Embed WithCustomAttributes(scoped ReadOnlySpan<(string, string?)> attributes)
{
foreach ((string key, string? value) in attributes)
{
WriteKey(key);
WriteValue(value);
}
return this;
}
private void WriteKey(string key)
{
writer.Write(' ');
writer.Write(key);
}
private void WriteValue(string? value)
{
writer.Write("=\"");
writer.Write(value);
writer.Write('"');
}
public void Close() => writer.Write("/>");
HtmlElementCloser IHtmlElement<Embed>.End() => throw new NotSupportedException();
// IHtmlElement<TSelf> implementation
TextWriter IHtmlElement<Embed>.Writer => writer;
static Embed IHtmlElement<Embed>.Create(TextWriter writer) => new(writer);
static bool IHtmlElement<Embed>.IsVoidElement => true;
static string IHtmlElement<Embed>.Name => ElementName;
static ReadOnlySpan<string> IHtmlElement<Embed>.SupportedAttributes => _supportedAttributes;
private static readonly string[] _supportedAttributes =
[
"accesskey",
"autocapitalize",
"class",
"contenteditable",
"dir",
"draggable",
"height",
"hidden",
"id",
"itemprop",
"lang",
"role",
"slot",
"spellcheck",
"src",
"style",
"tabindex",
"title",
"translate",
"type",
"width",
];
}
+50 -62
View File
@@ -4,7 +4,11 @@
namespace AssetRipper.Text.Html;
public readonly ref partial struct Fieldset
public readonly ref partial struct Fieldset : IHtmlElement<Fieldset>,
IDisabledAttribute<Fieldset>,
IFormAttribute<Fieldset>,
INameAttribute<Fieldset>,
IGlobalAttributes<Fieldset>
{
private const string ElementName = "fieldset";
private readonly TextWriter writer;
@@ -15,7 +19,7 @@ public readonly ref partial struct Fieldset
writer.Write($"<{ElementName}");
}
public string? Accesskey
public string? AccessKey
{
set
{
@@ -25,9 +29,9 @@ public readonly ref partial struct Fieldset
}
}
public Fieldset WithAccesskey(string? value = null)
public Fieldset WithAccessKey(string? value = null)
{
Accesskey = value;
AccessKey = value;
return this;
}
@@ -63,7 +67,7 @@ public readonly ref partial struct Fieldset
return this;
}
public string? Contenteditable
public string? ContentEditable
{
set
{
@@ -73,25 +77,9 @@ public readonly ref partial struct Fieldset
}
}
public Fieldset WithContenteditable(string? value = null)
public Fieldset WithContentEditable(string? value = null)
{
Contenteditable = value;
return this;
}
public string? Contextmenu
{
set
{
writer.Write(" contextmenu=\"");
writer.Write(value);
writer.Write('"');
}
}
public Fieldset WithContextmenu(string? value = null)
{
Contextmenu = value;
ContentEditable = value;
return this;
}
@@ -191,7 +179,7 @@ public readonly ref partial struct Fieldset
return this;
}
public string? Itemprop
public string? ItemProp
{
set
{
@@ -201,9 +189,9 @@ public readonly ref partial struct Fieldset
}
}
public Fieldset WithItemprop(string? value = null)
public Fieldset WithItemProp(string? value = null)
{
Itemprop = value;
ItemProp = value;
return this;
}
@@ -271,7 +259,7 @@ public readonly ref partial struct Fieldset
return this;
}
public string? Spellcheck
public string? SpellCheck
{
set
{
@@ -281,9 +269,9 @@ public readonly ref partial struct Fieldset
}
}
public Fieldset WithSpellcheck(string? value = null)
public Fieldset WithSpellCheck(string? value = null)
{
Spellcheck = value;
SpellCheck = value;
return this;
}
@@ -303,7 +291,7 @@ public readonly ref partial struct Fieldset
return this;
}
public string? Tabindex
public string? TabIndex
{
set
{
@@ -313,9 +301,9 @@ public readonly ref partial struct Fieldset
}
}
public Fieldset WithTabindex(string? value = null)
public Fieldset WithTabIndex(string? value = null)
{
Tabindex = value;
TabIndex = value;
return this;
}
@@ -351,36 +339,6 @@ public readonly ref partial struct Fieldset
return this;
}
public Fieldset WithCustomAttribute(string key, string? value = null)
{
WriteKey(key);
WriteValue(value);
return this;
}
public Fieldset WithCustomAttributes(scoped ReadOnlySpan<(string, string?)> attributes)
{
foreach ((string key, string? value) in attributes)
{
WriteKey(key);
WriteValue(value);
}
return this;
}
private void WriteKey(string key)
{
writer.Write(' ');
writer.Write(key);
}
private void WriteValue(string? value)
{
writer.Write("=\"");
writer.Write(value);
writer.Write('"');
}
public void Close() => writer.Write($"></{ElementName}>");
/// <summary>
@@ -401,4 +359,34 @@ public readonly ref partial struct Fieldset
writer.Write('>');
return new HtmlElementCloser(writer, $"</{ElementName}>");
}
// IHtmlElement<TSelf> implementation
TextWriter IHtmlElement<Fieldset>.Writer => writer;
static Fieldset IHtmlElement<Fieldset>.Create(TextWriter writer) => new(writer);
static bool IHtmlElement<Fieldset>.IsVoidElement => false;
static string IHtmlElement<Fieldset>.Name => ElementName;
static ReadOnlySpan<string> IHtmlElement<Fieldset>.SupportedAttributes => _supportedAttributes;
private static readonly string[] _supportedAttributes =
[
"accesskey",
"autocapitalize",
"class",
"contenteditable",
"dir",
"disabled",
"draggable",
"form",
"hidden",
"id",
"itemprop",
"lang",
"name",
"role",
"slot",
"spellcheck",
"style",
"tabindex",
"title",
"translate",
];
}
+44 -62
View File
@@ -4,7 +4,8 @@
namespace AssetRipper.Text.Html;
public readonly ref partial struct Figcaption
public readonly ref partial struct Figcaption : IHtmlElement<Figcaption>,
IGlobalAttributes<Figcaption>
{
private const string ElementName = "figcaption";
private readonly TextWriter writer;
@@ -15,7 +16,7 @@ public readonly ref partial struct Figcaption
writer.Write($"<{ElementName}");
}
public string? Accesskey
public string? AccessKey
{
set
{
@@ -25,9 +26,9 @@ public readonly ref partial struct Figcaption
}
}
public Figcaption WithAccesskey(string? value = null)
public Figcaption WithAccessKey(string? value = null)
{
Accesskey = value;
AccessKey = value;
return this;
}
@@ -63,7 +64,7 @@ public readonly ref partial struct Figcaption
return this;
}
public string? Contenteditable
public string? ContentEditable
{
set
{
@@ -73,25 +74,9 @@ public readonly ref partial struct Figcaption
}
}
public Figcaption WithContenteditable(string? value = null)
public Figcaption WithContentEditable(string? value = null)
{
Contenteditable = value;
return this;
}
public string? Contextmenu
{
set
{
writer.Write(" contextmenu=\"");
writer.Write(value);
writer.Write('"');
}
}
public Figcaption WithContextmenu(string? value = null)
{
Contextmenu = value;
ContentEditable = value;
return this;
}
@@ -159,7 +144,7 @@ public readonly ref partial struct Figcaption
return this;
}
public string? Itemprop
public string? ItemProp
{
set
{
@@ -169,9 +154,9 @@ public readonly ref partial struct Figcaption
}
}
public Figcaption WithItemprop(string? value = null)
public Figcaption WithItemProp(string? value = null)
{
Itemprop = value;
ItemProp = value;
return this;
}
@@ -223,7 +208,7 @@ public readonly ref partial struct Figcaption
return this;
}
public string? Spellcheck
public string? SpellCheck
{
set
{
@@ -233,9 +218,9 @@ public readonly ref partial struct Figcaption
}
}
public Figcaption WithSpellcheck(string? value = null)
public Figcaption WithSpellCheck(string? value = null)
{
Spellcheck = value;
SpellCheck = value;
return this;
}
@@ -255,7 +240,7 @@ public readonly ref partial struct Figcaption
return this;
}
public string? Tabindex
public string? TabIndex
{
set
{
@@ -265,9 +250,9 @@ public readonly ref partial struct Figcaption
}
}
public Figcaption WithTabindex(string? value = null)
public Figcaption WithTabIndex(string? value = null)
{
Tabindex = value;
TabIndex = value;
return this;
}
@@ -303,36 +288,6 @@ public readonly ref partial struct Figcaption
return this;
}
public Figcaption WithCustomAttribute(string key, string? value = null)
{
WriteKey(key);
WriteValue(value);
return this;
}
public Figcaption WithCustomAttributes(scoped ReadOnlySpan<(string, string?)> attributes)
{
foreach ((string key, string? value) in attributes)
{
WriteKey(key);
WriteValue(value);
}
return this;
}
private void WriteKey(string key)
{
writer.Write(' ');
writer.Write(key);
}
private void WriteValue(string? value)
{
writer.Write("=\"");
writer.Write(value);
writer.Write('"');
}
public void Close() => writer.Write($"></{ElementName}>");
/// <summary>
@@ -353,4 +308,31 @@ public readonly ref partial struct Figcaption
writer.Write('>');
return new HtmlElementCloser(writer, $"</{ElementName}>");
}
// IHtmlElement<TSelf> implementation
TextWriter IHtmlElement<Figcaption>.Writer => writer;
static Figcaption IHtmlElement<Figcaption>.Create(TextWriter writer) => new(writer);
static bool IHtmlElement<Figcaption>.IsVoidElement => false;
static string IHtmlElement<Figcaption>.Name => ElementName;
static ReadOnlySpan<string> IHtmlElement<Figcaption>.SupportedAttributes => _supportedAttributes;
private static readonly string[] _supportedAttributes =
[
"accesskey",
"autocapitalize",
"class",
"contenteditable",
"dir",
"draggable",
"hidden",
"id",
"itemprop",
"lang",
"role",
"slot",
"spellcheck",
"style",
"tabindex",
"title",
"translate",
];
}
+44 -62
View File
@@ -4,7 +4,8 @@
namespace AssetRipper.Text.Html;
public readonly ref partial struct Figure
public readonly ref partial struct Figure : IHtmlElement<Figure>,
IGlobalAttributes<Figure>
{
private const string ElementName = "figure";
private readonly TextWriter writer;
@@ -15,7 +16,7 @@ public readonly ref partial struct Figure
writer.Write($"<{ElementName}");
}
public string? Accesskey
public string? AccessKey
{
set
{
@@ -25,9 +26,9 @@ public readonly ref partial struct Figure
}
}
public Figure WithAccesskey(string? value = null)
public Figure WithAccessKey(string? value = null)
{
Accesskey = value;
AccessKey = value;
return this;
}
@@ -63,7 +64,7 @@ public readonly ref partial struct Figure
return this;
}
public string? Contenteditable
public string? ContentEditable
{
set
{
@@ -73,25 +74,9 @@ public readonly ref partial struct Figure
}
}
public Figure WithContenteditable(string? value = null)
public Figure WithContentEditable(string? value = null)
{
Contenteditable = value;
return this;
}
public string? Contextmenu
{
set
{
writer.Write(" contextmenu=\"");
writer.Write(value);
writer.Write('"');
}
}
public Figure WithContextmenu(string? value = null)
{
Contextmenu = value;
ContentEditable = value;
return this;
}
@@ -159,7 +144,7 @@ public readonly ref partial struct Figure
return this;
}
public string? Itemprop
public string? ItemProp
{
set
{
@@ -169,9 +154,9 @@ public readonly ref partial struct Figure
}
}
public Figure WithItemprop(string? value = null)
public Figure WithItemProp(string? value = null)
{
Itemprop = value;
ItemProp = value;
return this;
}
@@ -223,7 +208,7 @@ public readonly ref partial struct Figure
return this;
}
public string? Spellcheck
public string? SpellCheck
{
set
{
@@ -233,9 +218,9 @@ public readonly ref partial struct Figure
}
}
public Figure WithSpellcheck(string? value = null)
public Figure WithSpellCheck(string? value = null)
{
Spellcheck = value;
SpellCheck = value;
return this;
}
@@ -255,7 +240,7 @@ public readonly ref partial struct Figure
return this;
}
public string? Tabindex
public string? TabIndex
{
set
{
@@ -265,9 +250,9 @@ public readonly ref partial struct Figure
}
}
public Figure WithTabindex(string? value = null)
public Figure WithTabIndex(string? value = null)
{
Tabindex = value;
TabIndex = value;
return this;
}
@@ -303,36 +288,6 @@ public readonly ref partial struct Figure
return this;
}
public Figure WithCustomAttribute(string key, string? value = null)
{
WriteKey(key);
WriteValue(value);
return this;
}
public Figure WithCustomAttributes(scoped ReadOnlySpan<(string, string?)> attributes)
{
foreach ((string key, string? value) in attributes)
{
WriteKey(key);
WriteValue(value);
}
return this;
}
private void WriteKey(string key)
{
writer.Write(' ');
writer.Write(key);
}
private void WriteValue(string? value)
{
writer.Write("=\"");
writer.Write(value);
writer.Write('"');
}
public void Close() => writer.Write($"></{ElementName}>");
/// <summary>
@@ -353,4 +308,31 @@ public readonly ref partial struct Figure
writer.Write('>');
return new HtmlElementCloser(writer, $"</{ElementName}>");
}
// IHtmlElement<TSelf> implementation
TextWriter IHtmlElement<Figure>.Writer => writer;
static Figure IHtmlElement<Figure>.Create(TextWriter writer) => new(writer);
static bool IHtmlElement<Figure>.IsVoidElement => false;
static string IHtmlElement<Figure>.Name => ElementName;
static ReadOnlySpan<string> IHtmlElement<Figure>.SupportedAttributes => _supportedAttributes;
private static readonly string[] _supportedAttributes =
[
"accesskey",
"autocapitalize",
"class",
"contenteditable",
"dir",
"draggable",
"hidden",
"id",
"itemprop",
"lang",
"role",
"slot",
"spellcheck",
"style",
"tabindex",
"title",
"translate",
];
}
+46 -62
View File
@@ -4,7 +4,9 @@
namespace AssetRipper.Text.Html;
public readonly ref partial struct Font
public readonly ref partial struct Font : IHtmlElement<Font>,
IColorAttribute<Font>,
IGlobalAttributes<Font>
{
private const string ElementName = "font";
private readonly TextWriter writer;
@@ -15,7 +17,7 @@ public readonly ref partial struct Font
writer.Write($"<{ElementName}");
}
public string? Accesskey
public string? AccessKey
{
set
{
@@ -25,9 +27,9 @@ public readonly ref partial struct Font
}
}
public Font WithAccesskey(string? value = null)
public Font WithAccessKey(string? value = null)
{
Accesskey = value;
AccessKey = value;
return this;
}
@@ -79,7 +81,7 @@ public readonly ref partial struct Font
return this;
}
public string? Contenteditable
public string? ContentEditable
{
set
{
@@ -89,25 +91,9 @@ public readonly ref partial struct Font
}
}
public Font WithContenteditable(string? value = null)
public Font WithContentEditable(string? value = null)
{
Contenteditable = value;
return this;
}
public string? Contextmenu
{
set
{
writer.Write(" contextmenu=\"");
writer.Write(value);
writer.Write('"');
}
}
public Font WithContextmenu(string? value = null)
{
Contextmenu = value;
ContentEditable = value;
return this;
}
@@ -175,7 +161,7 @@ public readonly ref partial struct Font
return this;
}
public string? Itemprop
public string? ItemProp
{
set
{
@@ -185,9 +171,9 @@ public readonly ref partial struct Font
}
}
public Font WithItemprop(string? value = null)
public Font WithItemProp(string? value = null)
{
Itemprop = value;
ItemProp = value;
return this;
}
@@ -239,7 +225,7 @@ public readonly ref partial struct Font
return this;
}
public string? Spellcheck
public string? SpellCheck
{
set
{
@@ -249,9 +235,9 @@ public readonly ref partial struct Font
}
}
public Font WithSpellcheck(string? value = null)
public Font WithSpellCheck(string? value = null)
{
Spellcheck = value;
SpellCheck = value;
return this;
}
@@ -271,7 +257,7 @@ public readonly ref partial struct Font
return this;
}
public string? Tabindex
public string? TabIndex
{
set
{
@@ -281,9 +267,9 @@ public readonly ref partial struct Font
}
}
public Font WithTabindex(string? value = null)
public Font WithTabIndex(string? value = null)
{
Tabindex = value;
TabIndex = value;
return this;
}
@@ -319,36 +305,6 @@ public readonly ref partial struct Font
return this;
}
public Font WithCustomAttribute(string key, string? value = null)
{
WriteKey(key);
WriteValue(value);
return this;
}
public Font WithCustomAttributes(scoped ReadOnlySpan<(string, string?)> attributes)
{
foreach ((string key, string? value) in attributes)
{
WriteKey(key);
WriteValue(value);
}
return this;
}
private void WriteKey(string key)
{
writer.Write(' ');
writer.Write(key);
}
private void WriteValue(string? value)
{
writer.Write("=\"");
writer.Write(value);
writer.Write('"');
}
public void Close() => writer.Write($"></{ElementName}>");
/// <summary>
@@ -369,4 +325,32 @@ public readonly ref partial struct Font
writer.Write('>');
return new HtmlElementCloser(writer, $"</{ElementName}>");
}
// IHtmlElement<TSelf> implementation
TextWriter IHtmlElement<Font>.Writer => writer;
static Font IHtmlElement<Font>.Create(TextWriter writer) => new(writer);
static bool IHtmlElement<Font>.IsVoidElement => false;
static string IHtmlElement<Font>.Name => ElementName;
static ReadOnlySpan<string> IHtmlElement<Font>.SupportedAttributes => _supportedAttributes;
private static readonly string[] _supportedAttributes =
[
"accesskey",
"autocapitalize",
"class",
"color",
"contenteditable",
"dir",
"draggable",
"hidden",
"id",
"itemprop",
"lang",
"role",
"slot",
"spellcheck",
"style",
"tabindex",
"title",
"translate",
];
}
+44 -62
View File
@@ -4,7 +4,8 @@
namespace AssetRipper.Text.Html;
public readonly ref partial struct Footer
public readonly ref partial struct Footer : IHtmlElement<Footer>,
IGlobalAttributes<Footer>
{
private const string ElementName = "footer";
private readonly TextWriter writer;
@@ -15,7 +16,7 @@ public readonly ref partial struct Footer
writer.Write($"<{ElementName}");
}
public string? Accesskey
public string? AccessKey
{
set
{
@@ -25,9 +26,9 @@ public readonly ref partial struct Footer
}
}
public Footer WithAccesskey(string? value = null)
public Footer WithAccessKey(string? value = null)
{
Accesskey = value;
AccessKey = value;
return this;
}
@@ -63,7 +64,7 @@ public readonly ref partial struct Footer
return this;
}
public string? Contenteditable
public string? ContentEditable
{
set
{
@@ -73,25 +74,9 @@ public readonly ref partial struct Footer
}
}
public Footer WithContenteditable(string? value = null)
public Footer WithContentEditable(string? value = null)
{
Contenteditable = value;
return this;
}
public string? Contextmenu
{
set
{
writer.Write(" contextmenu=\"");
writer.Write(value);
writer.Write('"');
}
}
public Footer WithContextmenu(string? value = null)
{
Contextmenu = value;
ContentEditable = value;
return this;
}
@@ -159,7 +144,7 @@ public readonly ref partial struct Footer
return this;
}
public string? Itemprop
public string? ItemProp
{
set
{
@@ -169,9 +154,9 @@ public readonly ref partial struct Footer
}
}
public Footer WithItemprop(string? value = null)
public Footer WithItemProp(string? value = null)
{
Itemprop = value;
ItemProp = value;
return this;
}
@@ -223,7 +208,7 @@ public readonly ref partial struct Footer
return this;
}
public string? Spellcheck
public string? SpellCheck
{
set
{
@@ -233,9 +218,9 @@ public readonly ref partial struct Footer
}
}
public Footer WithSpellcheck(string? value = null)
public Footer WithSpellCheck(string? value = null)
{
Spellcheck = value;
SpellCheck = value;
return this;
}
@@ -255,7 +240,7 @@ public readonly ref partial struct Footer
return this;
}
public string? Tabindex
public string? TabIndex
{
set
{
@@ -265,9 +250,9 @@ public readonly ref partial struct Footer
}
}
public Footer WithTabindex(string? value = null)
public Footer WithTabIndex(string? value = null)
{
Tabindex = value;
TabIndex = value;
return this;
}
@@ -303,36 +288,6 @@ public readonly ref partial struct Footer
return this;
}
public Footer WithCustomAttribute(string key, string? value = null)
{
WriteKey(key);
WriteValue(value);
return this;
}
public Footer WithCustomAttributes(scoped ReadOnlySpan<(string, string?)> attributes)
{
foreach ((string key, string? value) in attributes)
{
WriteKey(key);
WriteValue(value);
}
return this;
}
private void WriteKey(string key)
{
writer.Write(' ');
writer.Write(key);
}
private void WriteValue(string? value)
{
writer.Write("=\"");
writer.Write(value);
writer.Write('"');
}
public void Close() => writer.Write($"></{ElementName}>");
/// <summary>
@@ -353,4 +308,31 @@ public readonly ref partial struct Footer
writer.Write('>');
return new HtmlElementCloser(writer, $"</{ElementName}>");
}
// IHtmlElement<TSelf> implementation
TextWriter IHtmlElement<Footer>.Writer => writer;
static Footer IHtmlElement<Footer>.Create(TextWriter writer) => new(writer);
static bool IHtmlElement<Footer>.IsVoidElement => false;
static string IHtmlElement<Footer>.Name => ElementName;
static ReadOnlySpan<string> IHtmlElement<Footer>.SupportedAttributes => _supportedAttributes;
private static readonly string[] _supportedAttributes =
[
"accesskey",
"autocapitalize",
"class",
"contenteditable",
"dir",
"draggable",
"hidden",
"id",
"itemprop",
"lang",
"role",
"slot",
"spellcheck",
"style",
"tabindex",
"title",
"translate",
];
}
+62 -62
View File
@@ -4,7 +4,17 @@
namespace AssetRipper.Text.Html;
public readonly ref partial struct Form
public readonly ref partial struct Form : IHtmlElement<Form>,
IAcceptAttribute<Form>,
IAcceptCharsetAttribute<Form>,
IActionAttribute<Form>,
IAutocompleteAttribute<Form>,
IEnctypeAttribute<Form>,
IMethodAttribute<Form>,
INameAttribute<Form>,
INovalidateAttribute<Form>,
ITargetAttribute<Form>,
IGlobalAttributes<Form>
{
private const string ElementName = "form";
private readonly TextWriter writer;
@@ -47,7 +57,7 @@ public readonly ref partial struct Form
return this;
}
public string? Accesskey
public string? AccessKey
{
set
{
@@ -57,9 +67,9 @@ public readonly ref partial struct Form
}
}
public Form WithAccesskey(string? value = null)
public Form WithAccessKey(string? value = null)
{
Accesskey = value;
AccessKey = value;
return this;
}
@@ -127,7 +137,7 @@ public readonly ref partial struct Form
return this;
}
public string? Contenteditable
public string? ContentEditable
{
set
{
@@ -137,25 +147,9 @@ public readonly ref partial struct Form
}
}
public Form WithContenteditable(string? value = null)
public Form WithContentEditable(string? value = null)
{
Contenteditable = value;
return this;
}
public string? Contextmenu
{
set
{
writer.Write(" contextmenu=\"");
writer.Write(value);
writer.Write('"');
}
}
public Form WithContextmenu(string? value = null)
{
Contextmenu = value;
ContentEditable = value;
return this;
}
@@ -239,7 +233,7 @@ public readonly ref partial struct Form
return this;
}
public string? Itemprop
public string? ItemProp
{
set
{
@@ -249,9 +243,9 @@ public readonly ref partial struct Form
}
}
public Form WithItemprop(string? value = null)
public Form WithItemProp(string? value = null)
{
Itemprop = value;
ItemProp = value;
return this;
}
@@ -351,7 +345,7 @@ public readonly ref partial struct Form
return this;
}
public string? Spellcheck
public string? SpellCheck
{
set
{
@@ -361,9 +355,9 @@ public readonly ref partial struct Form
}
}
public Form WithSpellcheck(string? value = null)
public Form WithSpellCheck(string? value = null)
{
Spellcheck = value;
SpellCheck = value;
return this;
}
@@ -383,7 +377,7 @@ public readonly ref partial struct Form
return this;
}
public string? Tabindex
public string? TabIndex
{
set
{
@@ -393,9 +387,9 @@ public readonly ref partial struct Form
}
}
public Form WithTabindex(string? value = null)
public Form WithTabIndex(string? value = null)
{
Tabindex = value;
TabIndex = value;
return this;
}
@@ -447,36 +441,6 @@ public readonly ref partial struct Form
return this;
}
public Form WithCustomAttribute(string key, string? value = null)
{
WriteKey(key);
WriteValue(value);
return this;
}
public Form WithCustomAttributes(scoped ReadOnlySpan<(string, string?)> attributes)
{
foreach ((string key, string? value) in attributes)
{
WriteKey(key);
WriteValue(value);
}
return this;
}
private void WriteKey(string key)
{
writer.Write(' ');
writer.Write(key);
}
private void WriteValue(string? value)
{
writer.Write("=\"");
writer.Write(value);
writer.Write('"');
}
public void Close() => writer.Write($"></{ElementName}>");
/// <summary>
@@ -497,4 +461,40 @@ public readonly ref partial struct Form
writer.Write('>');
return new HtmlElementCloser(writer, $"</{ElementName}>");
}
// IHtmlElement<TSelf> implementation
TextWriter IHtmlElement<Form>.Writer => writer;
static Form IHtmlElement<Form>.Create(TextWriter writer) => new(writer);
static bool IHtmlElement<Form>.IsVoidElement => false;
static string IHtmlElement<Form>.Name => ElementName;
static ReadOnlySpan<string> IHtmlElement<Form>.SupportedAttributes => _supportedAttributes;
private static readonly string[] _supportedAttributes =
[
"accept",
"accept-charset",
"accesskey",
"action",
"autocapitalize",
"autocomplete",
"class",
"contenteditable",
"dir",
"draggable",
"enctype",
"hidden",
"id",
"itemprop",
"lang",
"method",
"name",
"novalidate",
"role",
"slot",
"spellcheck",
"style",
"tabindex",
"target",
"title",
"translate",
];
}
+44 -62
View File
@@ -4,7 +4,8 @@
namespace AssetRipper.Text.Html;
public readonly ref partial struct Frame
public readonly ref partial struct Frame : IHtmlElement<Frame>,
IGlobalAttributes<Frame>
{
private const string ElementName = "frame";
private readonly TextWriter writer;
@@ -15,7 +16,7 @@ public readonly ref partial struct Frame
writer.Write($"<{ElementName}");
}
public string? Accesskey
public string? AccessKey
{
set
{
@@ -25,9 +26,9 @@ public readonly ref partial struct Frame
}
}
public Frame WithAccesskey(string? value = null)
public Frame WithAccessKey(string? value = null)
{
Accesskey = value;
AccessKey = value;
return this;
}
@@ -63,7 +64,7 @@ public readonly ref partial struct Frame
return this;
}
public string? Contenteditable
public string? ContentEditable
{
set
{
@@ -73,25 +74,9 @@ public readonly ref partial struct Frame
}
}
public Frame WithContenteditable(string? value = null)
public Frame WithContentEditable(string? value = null)
{
Contenteditable = value;
return this;
}
public string? Contextmenu
{
set
{
writer.Write(" contextmenu=\"");
writer.Write(value);
writer.Write('"');
}
}
public Frame WithContextmenu(string? value = null)
{
Contextmenu = value;
ContentEditable = value;
return this;
}
@@ -159,7 +144,7 @@ public readonly ref partial struct Frame
return this;
}
public string? Itemprop
public string? ItemProp
{
set
{
@@ -169,9 +154,9 @@ public readonly ref partial struct Frame
}
}
public Frame WithItemprop(string? value = null)
public Frame WithItemProp(string? value = null)
{
Itemprop = value;
ItemProp = value;
return this;
}
@@ -223,7 +208,7 @@ public readonly ref partial struct Frame
return this;
}
public string? Spellcheck
public string? SpellCheck
{
set
{
@@ -233,9 +218,9 @@ public readonly ref partial struct Frame
}
}
public Frame WithSpellcheck(string? value = null)
public Frame WithSpellCheck(string? value = null)
{
Spellcheck = value;
SpellCheck = value;
return this;
}
@@ -255,7 +240,7 @@ public readonly ref partial struct Frame
return this;
}
public string? Tabindex
public string? TabIndex
{
set
{
@@ -265,9 +250,9 @@ public readonly ref partial struct Frame
}
}
public Frame WithTabindex(string? value = null)
public Frame WithTabIndex(string? value = null)
{
Tabindex = value;
TabIndex = value;
return this;
}
@@ -303,36 +288,6 @@ public readonly ref partial struct Frame
return this;
}
public Frame WithCustomAttribute(string key, string? value = null)
{
WriteKey(key);
WriteValue(value);
return this;
}
public Frame WithCustomAttributes(scoped ReadOnlySpan<(string, string?)> attributes)
{
foreach ((string key, string? value) in attributes)
{
WriteKey(key);
WriteValue(value);
}
return this;
}
private void WriteKey(string key)
{
writer.Write(' ');
writer.Write(key);
}
private void WriteValue(string? value)
{
writer.Write("=\"");
writer.Write(value);
writer.Write('"');
}
public void Close() => writer.Write($"></{ElementName}>");
/// <summary>
@@ -353,4 +308,31 @@ public readonly ref partial struct Frame
writer.Write('>');
return new HtmlElementCloser(writer, $"</{ElementName}>");
}
// IHtmlElement<TSelf> implementation
TextWriter IHtmlElement<Frame>.Writer => writer;
static Frame IHtmlElement<Frame>.Create(TextWriter writer) => new(writer);
static bool IHtmlElement<Frame>.IsVoidElement => false;
static string IHtmlElement<Frame>.Name => ElementName;
static ReadOnlySpan<string> IHtmlElement<Frame>.SupportedAttributes => _supportedAttributes;
private static readonly string[] _supportedAttributes =
[
"accesskey",
"autocapitalize",
"class",
"contenteditable",
"dir",
"draggable",
"hidden",
"id",
"itemprop",
"lang",
"role",
"slot",
"spellcheck",
"style",
"tabindex",
"title",
"translate",
];
}
+44 -62
View File
@@ -4,7 +4,8 @@
namespace AssetRipper.Text.Html;
public readonly ref partial struct Frameset
public readonly ref partial struct Frameset : IHtmlElement<Frameset>,
IGlobalAttributes<Frameset>
{
private const string ElementName = "frameset";
private readonly TextWriter writer;
@@ -15,7 +16,7 @@ public readonly ref partial struct Frameset
writer.Write($"<{ElementName}");
}
public string? Accesskey
public string? AccessKey
{
set
{
@@ -25,9 +26,9 @@ public readonly ref partial struct Frameset
}
}
public Frameset WithAccesskey(string? value = null)
public Frameset WithAccessKey(string? value = null)
{
Accesskey = value;
AccessKey = value;
return this;
}
@@ -63,7 +64,7 @@ public readonly ref partial struct Frameset
return this;
}
public string? Contenteditable
public string? ContentEditable
{
set
{
@@ -73,25 +74,9 @@ public readonly ref partial struct Frameset
}
}
public Frameset WithContenteditable(string? value = null)
public Frameset WithContentEditable(string? value = null)
{
Contenteditable = value;
return this;
}
public string? Contextmenu
{
set
{
writer.Write(" contextmenu=\"");
writer.Write(value);
writer.Write('"');
}
}
public Frameset WithContextmenu(string? value = null)
{
Contextmenu = value;
ContentEditable = value;
return this;
}
@@ -159,7 +144,7 @@ public readonly ref partial struct Frameset
return this;
}
public string? Itemprop
public string? ItemProp
{
set
{
@@ -169,9 +154,9 @@ public readonly ref partial struct Frameset
}
}
public Frameset WithItemprop(string? value = null)
public Frameset WithItemProp(string? value = null)
{
Itemprop = value;
ItemProp = value;
return this;
}
@@ -223,7 +208,7 @@ public readonly ref partial struct Frameset
return this;
}
public string? Spellcheck
public string? SpellCheck
{
set
{
@@ -233,9 +218,9 @@ public readonly ref partial struct Frameset
}
}
public Frameset WithSpellcheck(string? value = null)
public Frameset WithSpellCheck(string? value = null)
{
Spellcheck = value;
SpellCheck = value;
return this;
}
@@ -255,7 +240,7 @@ public readonly ref partial struct Frameset
return this;
}
public string? Tabindex
public string? TabIndex
{
set
{
@@ -265,9 +250,9 @@ public readonly ref partial struct Frameset
}
}
public Frameset WithTabindex(string? value = null)
public Frameset WithTabIndex(string? value = null)
{
Tabindex = value;
TabIndex = value;
return this;
}
@@ -303,36 +288,6 @@ public readonly ref partial struct Frameset
return this;
}
public Frameset WithCustomAttribute(string key, string? value = null)
{
WriteKey(key);
WriteValue(value);
return this;
}
public Frameset WithCustomAttributes(scoped ReadOnlySpan<(string, string?)> attributes)
{
foreach ((string key, string? value) in attributes)
{
WriteKey(key);
WriteValue(value);
}
return this;
}
private void WriteKey(string key)
{
writer.Write(' ');
writer.Write(key);
}
private void WriteValue(string? value)
{
writer.Write("=\"");
writer.Write(value);
writer.Write('"');
}
public void Close() => writer.Write($"></{ElementName}>");
/// <summary>
@@ -353,4 +308,31 @@ public readonly ref partial struct Frameset
writer.Write('>');
return new HtmlElementCloser(writer, $"</{ElementName}>");
}
// IHtmlElement<TSelf> implementation
TextWriter IHtmlElement<Frameset>.Writer => writer;
static Frameset IHtmlElement<Frameset>.Create(TextWriter writer) => new(writer);
static bool IHtmlElement<Frameset>.IsVoidElement => false;
static string IHtmlElement<Frameset>.Name => ElementName;
static ReadOnlySpan<string> IHtmlElement<Frameset>.SupportedAttributes => _supportedAttributes;
private static readonly string[] _supportedAttributes =
[
"accesskey",
"autocapitalize",
"class",
"contenteditable",
"dir",
"draggable",
"hidden",
"id",
"itemprop",
"lang",
"role",
"slot",
"spellcheck",
"style",
"tabindex",
"title",
"translate",
];
}
+44 -62
View File
@@ -4,7 +4,8 @@
namespace AssetRipper.Text.Html;
public readonly ref partial struct H1
public readonly ref partial struct H1 : IHtmlElement<H1>,
IGlobalAttributes<H1>
{
private const string ElementName = "h1";
private readonly TextWriter writer;
@@ -15,7 +16,7 @@ public readonly ref partial struct H1
writer.Write($"<{ElementName}");
}
public string? Accesskey
public string? AccessKey
{
set
{
@@ -25,9 +26,9 @@ public readonly ref partial struct H1
}
}
public H1 WithAccesskey(string? value = null)
public H1 WithAccessKey(string? value = null)
{
Accesskey = value;
AccessKey = value;
return this;
}
@@ -63,7 +64,7 @@ public readonly ref partial struct H1
return this;
}
public string? Contenteditable
public string? ContentEditable
{
set
{
@@ -73,25 +74,9 @@ public readonly ref partial struct H1
}
}
public H1 WithContenteditable(string? value = null)
public H1 WithContentEditable(string? value = null)
{
Contenteditable = value;
return this;
}
public string? Contextmenu
{
set
{
writer.Write(" contextmenu=\"");
writer.Write(value);
writer.Write('"');
}
}
public H1 WithContextmenu(string? value = null)
{
Contextmenu = value;
ContentEditable = value;
return this;
}
@@ -159,7 +144,7 @@ public readonly ref partial struct H1
return this;
}
public string? Itemprop
public string? ItemProp
{
set
{
@@ -169,9 +154,9 @@ public readonly ref partial struct H1
}
}
public H1 WithItemprop(string? value = null)
public H1 WithItemProp(string? value = null)
{
Itemprop = value;
ItemProp = value;
return this;
}
@@ -223,7 +208,7 @@ public readonly ref partial struct H1
return this;
}
public string? Spellcheck
public string? SpellCheck
{
set
{
@@ -233,9 +218,9 @@ public readonly ref partial struct H1
}
}
public H1 WithSpellcheck(string? value = null)
public H1 WithSpellCheck(string? value = null)
{
Spellcheck = value;
SpellCheck = value;
return this;
}
@@ -255,7 +240,7 @@ public readonly ref partial struct H1
return this;
}
public string? Tabindex
public string? TabIndex
{
set
{
@@ -265,9 +250,9 @@ public readonly ref partial struct H1
}
}
public H1 WithTabindex(string? value = null)
public H1 WithTabIndex(string? value = null)
{
Tabindex = value;
TabIndex = value;
return this;
}
@@ -303,36 +288,6 @@ public readonly ref partial struct H1
return this;
}
public H1 WithCustomAttribute(string key, string? value = null)
{
WriteKey(key);
WriteValue(value);
return this;
}
public H1 WithCustomAttributes(scoped ReadOnlySpan<(string, string?)> attributes)
{
foreach ((string key, string? value) in attributes)
{
WriteKey(key);
WriteValue(value);
}
return this;
}
private void WriteKey(string key)
{
writer.Write(' ');
writer.Write(key);
}
private void WriteValue(string? value)
{
writer.Write("=\"");
writer.Write(value);
writer.Write('"');
}
public void Close() => writer.Write($"></{ElementName}>");
/// <summary>
@@ -353,4 +308,31 @@ public readonly ref partial struct H1
writer.Write('>');
return new HtmlElementCloser(writer, $"</{ElementName}>");
}
// IHtmlElement<TSelf> implementation
TextWriter IHtmlElement<H1>.Writer => writer;
static H1 IHtmlElement<H1>.Create(TextWriter writer) => new(writer);
static bool IHtmlElement<H1>.IsVoidElement => false;
static string IHtmlElement<H1>.Name => ElementName;
static ReadOnlySpan<string> IHtmlElement<H1>.SupportedAttributes => _supportedAttributes;
private static readonly string[] _supportedAttributes =
[
"accesskey",
"autocapitalize",
"class",
"contenteditable",
"dir",
"draggable",
"hidden",
"id",
"itemprop",
"lang",
"role",
"slot",
"spellcheck",
"style",
"tabindex",
"title",
"translate",
];
}
+44 -62
View File
@@ -4,7 +4,8 @@
namespace AssetRipper.Text.Html;
public readonly ref partial struct H2
public readonly ref partial struct H2 : IHtmlElement<H2>,
IGlobalAttributes<H2>
{
private const string ElementName = "h2";
private readonly TextWriter writer;
@@ -15,7 +16,7 @@ public readonly ref partial struct H2
writer.Write($"<{ElementName}");
}
public string? Accesskey
public string? AccessKey
{
set
{
@@ -25,9 +26,9 @@ public readonly ref partial struct H2
}
}
public H2 WithAccesskey(string? value = null)
public H2 WithAccessKey(string? value = null)
{
Accesskey = value;
AccessKey = value;
return this;
}
@@ -63,7 +64,7 @@ public readonly ref partial struct H2
return this;
}
public string? Contenteditable
public string? ContentEditable
{
set
{
@@ -73,25 +74,9 @@ public readonly ref partial struct H2
}
}
public H2 WithContenteditable(string? value = null)
public H2 WithContentEditable(string? value = null)
{
Contenteditable = value;
return this;
}
public string? Contextmenu
{
set
{
writer.Write(" contextmenu=\"");
writer.Write(value);
writer.Write('"');
}
}
public H2 WithContextmenu(string? value = null)
{
Contextmenu = value;
ContentEditable = value;
return this;
}
@@ -159,7 +144,7 @@ public readonly ref partial struct H2
return this;
}
public string? Itemprop
public string? ItemProp
{
set
{
@@ -169,9 +154,9 @@ public readonly ref partial struct H2
}
}
public H2 WithItemprop(string? value = null)
public H2 WithItemProp(string? value = null)
{
Itemprop = value;
ItemProp = value;
return this;
}
@@ -223,7 +208,7 @@ public readonly ref partial struct H2
return this;
}
public string? Spellcheck
public string? SpellCheck
{
set
{
@@ -233,9 +218,9 @@ public readonly ref partial struct H2
}
}
public H2 WithSpellcheck(string? value = null)
public H2 WithSpellCheck(string? value = null)
{
Spellcheck = value;
SpellCheck = value;
return this;
}
@@ -255,7 +240,7 @@ public readonly ref partial struct H2
return this;
}
public string? Tabindex
public string? TabIndex
{
set
{
@@ -265,9 +250,9 @@ public readonly ref partial struct H2
}
}
public H2 WithTabindex(string? value = null)
public H2 WithTabIndex(string? value = null)
{
Tabindex = value;
TabIndex = value;
return this;
}
@@ -303,36 +288,6 @@ public readonly ref partial struct H2
return this;
}
public H2 WithCustomAttribute(string key, string? value = null)
{
WriteKey(key);
WriteValue(value);
return this;
}
public H2 WithCustomAttributes(scoped ReadOnlySpan<(string, string?)> attributes)
{
foreach ((string key, string? value) in attributes)
{
WriteKey(key);
WriteValue(value);
}
return this;
}
private void WriteKey(string key)
{
writer.Write(' ');
writer.Write(key);
}
private void WriteValue(string? value)
{
writer.Write("=\"");
writer.Write(value);
writer.Write('"');
}
public void Close() => writer.Write($"></{ElementName}>");
/// <summary>
@@ -353,4 +308,31 @@ public readonly ref partial struct H2
writer.Write('>');
return new HtmlElementCloser(writer, $"</{ElementName}>");
}
// IHtmlElement<TSelf> implementation
TextWriter IHtmlElement<H2>.Writer => writer;
static H2 IHtmlElement<H2>.Create(TextWriter writer) => new(writer);
static bool IHtmlElement<H2>.IsVoidElement => false;
static string IHtmlElement<H2>.Name => ElementName;
static ReadOnlySpan<string> IHtmlElement<H2>.SupportedAttributes => _supportedAttributes;
private static readonly string[] _supportedAttributes =
[
"accesskey",
"autocapitalize",
"class",
"contenteditable",
"dir",
"draggable",
"hidden",
"id",
"itemprop",
"lang",
"role",
"slot",
"spellcheck",
"style",
"tabindex",
"title",
"translate",
];
}
+44 -62
View File
@@ -4,7 +4,8 @@
namespace AssetRipper.Text.Html;
public readonly ref partial struct H3
public readonly ref partial struct H3 : IHtmlElement<H3>,
IGlobalAttributes<H3>
{
private const string ElementName = "h3";
private readonly TextWriter writer;
@@ -15,7 +16,7 @@ public readonly ref partial struct H3
writer.Write($"<{ElementName}");
}
public string? Accesskey
public string? AccessKey
{
set
{
@@ -25,9 +26,9 @@ public readonly ref partial struct H3
}
}
public H3 WithAccesskey(string? value = null)
public H3 WithAccessKey(string? value = null)
{
Accesskey = value;
AccessKey = value;
return this;
}
@@ -63,7 +64,7 @@ public readonly ref partial struct H3
return this;
}
public string? Contenteditable
public string? ContentEditable
{
set
{
@@ -73,25 +74,9 @@ public readonly ref partial struct H3
}
}
public H3 WithContenteditable(string? value = null)
public H3 WithContentEditable(string? value = null)
{
Contenteditable = value;
return this;
}
public string? Contextmenu
{
set
{
writer.Write(" contextmenu=\"");
writer.Write(value);
writer.Write('"');
}
}
public H3 WithContextmenu(string? value = null)
{
Contextmenu = value;
ContentEditable = value;
return this;
}
@@ -159,7 +144,7 @@ public readonly ref partial struct H3
return this;
}
public string? Itemprop
public string? ItemProp
{
set
{
@@ -169,9 +154,9 @@ public readonly ref partial struct H3
}
}
public H3 WithItemprop(string? value = null)
public H3 WithItemProp(string? value = null)
{
Itemprop = value;
ItemProp = value;
return this;
}
@@ -223,7 +208,7 @@ public readonly ref partial struct H3
return this;
}
public string? Spellcheck
public string? SpellCheck
{
set
{
@@ -233,9 +218,9 @@ public readonly ref partial struct H3
}
}
public H3 WithSpellcheck(string? value = null)
public H3 WithSpellCheck(string? value = null)
{
Spellcheck = value;
SpellCheck = value;
return this;
}
@@ -255,7 +240,7 @@ public readonly ref partial struct H3
return this;
}
public string? Tabindex
public string? TabIndex
{
set
{
@@ -265,9 +250,9 @@ public readonly ref partial struct H3
}
}
public H3 WithTabindex(string? value = null)
public H3 WithTabIndex(string? value = null)
{
Tabindex = value;
TabIndex = value;
return this;
}
@@ -303,36 +288,6 @@ public readonly ref partial struct H3
return this;
}
public H3 WithCustomAttribute(string key, string? value = null)
{
WriteKey(key);
WriteValue(value);
return this;
}
public H3 WithCustomAttributes(scoped ReadOnlySpan<(string, string?)> attributes)
{
foreach ((string key, string? value) in attributes)
{
WriteKey(key);
WriteValue(value);
}
return this;
}
private void WriteKey(string key)
{
writer.Write(' ');
writer.Write(key);
}
private void WriteValue(string? value)
{
writer.Write("=\"");
writer.Write(value);
writer.Write('"');
}
public void Close() => writer.Write($"></{ElementName}>");
/// <summary>
@@ -353,4 +308,31 @@ public readonly ref partial struct H3
writer.Write('>');
return new HtmlElementCloser(writer, $"</{ElementName}>");
}
// IHtmlElement<TSelf> implementation
TextWriter IHtmlElement<H3>.Writer => writer;
static H3 IHtmlElement<H3>.Create(TextWriter writer) => new(writer);
static bool IHtmlElement<H3>.IsVoidElement => false;
static string IHtmlElement<H3>.Name => ElementName;
static ReadOnlySpan<string> IHtmlElement<H3>.SupportedAttributes => _supportedAttributes;
private static readonly string[] _supportedAttributes =
[
"accesskey",
"autocapitalize",
"class",
"contenteditable",
"dir",
"draggable",
"hidden",
"id",
"itemprop",
"lang",
"role",
"slot",
"spellcheck",
"style",
"tabindex",
"title",
"translate",
];
}
+44 -62
View File
@@ -4,7 +4,8 @@
namespace AssetRipper.Text.Html;
public readonly ref partial struct H4
public readonly ref partial struct H4 : IHtmlElement<H4>,
IGlobalAttributes<H4>
{
private const string ElementName = "h4";
private readonly TextWriter writer;
@@ -15,7 +16,7 @@ public readonly ref partial struct H4
writer.Write($"<{ElementName}");
}
public string? Accesskey
public string? AccessKey
{
set
{
@@ -25,9 +26,9 @@ public readonly ref partial struct H4
}
}
public H4 WithAccesskey(string? value = null)
public H4 WithAccessKey(string? value = null)
{
Accesskey = value;
AccessKey = value;
return this;
}
@@ -63,7 +64,7 @@ public readonly ref partial struct H4
return this;
}
public string? Contenteditable
public string? ContentEditable
{
set
{
@@ -73,25 +74,9 @@ public readonly ref partial struct H4
}
}
public H4 WithContenteditable(string? value = null)
public H4 WithContentEditable(string? value = null)
{
Contenteditable = value;
return this;
}
public string? Contextmenu
{
set
{
writer.Write(" contextmenu=\"");
writer.Write(value);
writer.Write('"');
}
}
public H4 WithContextmenu(string? value = null)
{
Contextmenu = value;
ContentEditable = value;
return this;
}
@@ -159,7 +144,7 @@ public readonly ref partial struct H4
return this;
}
public string? Itemprop
public string? ItemProp
{
set
{
@@ -169,9 +154,9 @@ public readonly ref partial struct H4
}
}
public H4 WithItemprop(string? value = null)
public H4 WithItemProp(string? value = null)
{
Itemprop = value;
ItemProp = value;
return this;
}
@@ -223,7 +208,7 @@ public readonly ref partial struct H4
return this;
}
public string? Spellcheck
public string? SpellCheck
{
set
{
@@ -233,9 +218,9 @@ public readonly ref partial struct H4
}
}
public H4 WithSpellcheck(string? value = null)
public H4 WithSpellCheck(string? value = null)
{
Spellcheck = value;
SpellCheck = value;
return this;
}
@@ -255,7 +240,7 @@ public readonly ref partial struct H4
return this;
}
public string? Tabindex
public string? TabIndex
{
set
{
@@ -265,9 +250,9 @@ public readonly ref partial struct H4
}
}
public H4 WithTabindex(string? value = null)
public H4 WithTabIndex(string? value = null)
{
Tabindex = value;
TabIndex = value;
return this;
}
@@ -303,36 +288,6 @@ public readonly ref partial struct H4
return this;
}
public H4 WithCustomAttribute(string key, string? value = null)
{
WriteKey(key);
WriteValue(value);
return this;
}
public H4 WithCustomAttributes(scoped ReadOnlySpan<(string, string?)> attributes)
{
foreach ((string key, string? value) in attributes)
{
WriteKey(key);
WriteValue(value);
}
return this;
}
private void WriteKey(string key)
{
writer.Write(' ');
writer.Write(key);
}
private void WriteValue(string? value)
{
writer.Write("=\"");
writer.Write(value);
writer.Write('"');
}
public void Close() => writer.Write($"></{ElementName}>");
/// <summary>
@@ -353,4 +308,31 @@ public readonly ref partial struct H4
writer.Write('>');
return new HtmlElementCloser(writer, $"</{ElementName}>");
}
// IHtmlElement<TSelf> implementation
TextWriter IHtmlElement<H4>.Writer => writer;
static H4 IHtmlElement<H4>.Create(TextWriter writer) => new(writer);
static bool IHtmlElement<H4>.IsVoidElement => false;
static string IHtmlElement<H4>.Name => ElementName;
static ReadOnlySpan<string> IHtmlElement<H4>.SupportedAttributes => _supportedAttributes;
private static readonly string[] _supportedAttributes =
[
"accesskey",
"autocapitalize",
"class",
"contenteditable",
"dir",
"draggable",
"hidden",
"id",
"itemprop",
"lang",
"role",
"slot",
"spellcheck",
"style",
"tabindex",
"title",
"translate",
];
}
+44 -62
View File
@@ -4,7 +4,8 @@
namespace AssetRipper.Text.Html;
public readonly ref partial struct H5
public readonly ref partial struct H5 : IHtmlElement<H5>,
IGlobalAttributes<H5>
{
private const string ElementName = "h5";
private readonly TextWriter writer;
@@ -15,7 +16,7 @@ public readonly ref partial struct H5
writer.Write($"<{ElementName}");
}
public string? Accesskey
public string? AccessKey
{
set
{
@@ -25,9 +26,9 @@ public readonly ref partial struct H5
}
}
public H5 WithAccesskey(string? value = null)
public H5 WithAccessKey(string? value = null)
{
Accesskey = value;
AccessKey = value;
return this;
}
@@ -63,7 +64,7 @@ public readonly ref partial struct H5
return this;
}
public string? Contenteditable
public string? ContentEditable
{
set
{
@@ -73,25 +74,9 @@ public readonly ref partial struct H5
}
}
public H5 WithContenteditable(string? value = null)
public H5 WithContentEditable(string? value = null)
{
Contenteditable = value;
return this;
}
public string? Contextmenu
{
set
{
writer.Write(" contextmenu=\"");
writer.Write(value);
writer.Write('"');
}
}
public H5 WithContextmenu(string? value = null)
{
Contextmenu = value;
ContentEditable = value;
return this;
}
@@ -159,7 +144,7 @@ public readonly ref partial struct H5
return this;
}
public string? Itemprop
public string? ItemProp
{
set
{
@@ -169,9 +154,9 @@ public readonly ref partial struct H5
}
}
public H5 WithItemprop(string? value = null)
public H5 WithItemProp(string? value = null)
{
Itemprop = value;
ItemProp = value;
return this;
}
@@ -223,7 +208,7 @@ public readonly ref partial struct H5
return this;
}
public string? Spellcheck
public string? SpellCheck
{
set
{
@@ -233,9 +218,9 @@ public readonly ref partial struct H5
}
}
public H5 WithSpellcheck(string? value = null)
public H5 WithSpellCheck(string? value = null)
{
Spellcheck = value;
SpellCheck = value;
return this;
}
@@ -255,7 +240,7 @@ public readonly ref partial struct H5
return this;
}
public string? Tabindex
public string? TabIndex
{
set
{
@@ -265,9 +250,9 @@ public readonly ref partial struct H5
}
}
public H5 WithTabindex(string? value = null)
public H5 WithTabIndex(string? value = null)
{
Tabindex = value;
TabIndex = value;
return this;
}
@@ -303,36 +288,6 @@ public readonly ref partial struct H5
return this;
}
public H5 WithCustomAttribute(string key, string? value = null)
{
WriteKey(key);
WriteValue(value);
return this;
}
public H5 WithCustomAttributes(scoped ReadOnlySpan<(string, string?)> attributes)
{
foreach ((string key, string? value) in attributes)
{
WriteKey(key);
WriteValue(value);
}
return this;
}
private void WriteKey(string key)
{
writer.Write(' ');
writer.Write(key);
}
private void WriteValue(string? value)
{
writer.Write("=\"");
writer.Write(value);
writer.Write('"');
}
public void Close() => writer.Write($"></{ElementName}>");
/// <summary>
@@ -353,4 +308,31 @@ public readonly ref partial struct H5
writer.Write('>');
return new HtmlElementCloser(writer, $"</{ElementName}>");
}
// IHtmlElement<TSelf> implementation
TextWriter IHtmlElement<H5>.Writer => writer;
static H5 IHtmlElement<H5>.Create(TextWriter writer) => new(writer);
static bool IHtmlElement<H5>.IsVoidElement => false;
static string IHtmlElement<H5>.Name => ElementName;
static ReadOnlySpan<string> IHtmlElement<H5>.SupportedAttributes => _supportedAttributes;
private static readonly string[] _supportedAttributes =
[
"accesskey",
"autocapitalize",
"class",
"contenteditable",
"dir",
"draggable",
"hidden",
"id",
"itemprop",
"lang",
"role",
"slot",
"spellcheck",
"style",
"tabindex",
"title",
"translate",
];
}
+44 -62
View File
@@ -4,7 +4,8 @@
namespace AssetRipper.Text.Html;
public readonly ref partial struct H6
public readonly ref partial struct H6 : IHtmlElement<H6>,
IGlobalAttributes<H6>
{
private const string ElementName = "h6";
private readonly TextWriter writer;
@@ -15,7 +16,7 @@ public readonly ref partial struct H6
writer.Write($"<{ElementName}");
}
public string? Accesskey
public string? AccessKey
{
set
{
@@ -25,9 +26,9 @@ public readonly ref partial struct H6
}
}
public H6 WithAccesskey(string? value = null)
public H6 WithAccessKey(string? value = null)
{
Accesskey = value;
AccessKey = value;
return this;
}
@@ -63,7 +64,7 @@ public readonly ref partial struct H6
return this;
}
public string? Contenteditable
public string? ContentEditable
{
set
{
@@ -73,25 +74,9 @@ public readonly ref partial struct H6
}
}
public H6 WithContenteditable(string? value = null)
public H6 WithContentEditable(string? value = null)
{
Contenteditable = value;
return this;
}
public string? Contextmenu
{
set
{
writer.Write(" contextmenu=\"");
writer.Write(value);
writer.Write('"');
}
}
public H6 WithContextmenu(string? value = null)
{
Contextmenu = value;
ContentEditable = value;
return this;
}
@@ -159,7 +144,7 @@ public readonly ref partial struct H6
return this;
}
public string? Itemprop
public string? ItemProp
{
set
{
@@ -169,9 +154,9 @@ public readonly ref partial struct H6
}
}
public H6 WithItemprop(string? value = null)
public H6 WithItemProp(string? value = null)
{
Itemprop = value;
ItemProp = value;
return this;
}
@@ -223,7 +208,7 @@ public readonly ref partial struct H6
return this;
}
public string? Spellcheck
public string? SpellCheck
{
set
{
@@ -233,9 +218,9 @@ public readonly ref partial struct H6
}
}
public H6 WithSpellcheck(string? value = null)
public H6 WithSpellCheck(string? value = null)
{
Spellcheck = value;
SpellCheck = value;
return this;
}
@@ -255,7 +240,7 @@ public readonly ref partial struct H6
return this;
}
public string? Tabindex
public string? TabIndex
{
set
{
@@ -265,9 +250,9 @@ public readonly ref partial struct H6
}
}
public H6 WithTabindex(string? value = null)
public H6 WithTabIndex(string? value = null)
{
Tabindex = value;
TabIndex = value;
return this;
}
@@ -303,36 +288,6 @@ public readonly ref partial struct H6
return this;
}
public H6 WithCustomAttribute(string key, string? value = null)
{
WriteKey(key);
WriteValue(value);
return this;
}
public H6 WithCustomAttributes(scoped ReadOnlySpan<(string, string?)> attributes)
{
foreach ((string key, string? value) in attributes)
{
WriteKey(key);
WriteValue(value);
}
return this;
}
private void WriteKey(string key)
{
writer.Write(' ');
writer.Write(key);
}
private void WriteValue(string? value)
{
writer.Write("=\"");
writer.Write(value);
writer.Write('"');
}
public void Close() => writer.Write($"></{ElementName}>");
/// <summary>
@@ -353,4 +308,31 @@ public readonly ref partial struct H6
writer.Write('>');
return new HtmlElementCloser(writer, $"</{ElementName}>");
}
// IHtmlElement<TSelf> implementation
TextWriter IHtmlElement<H6>.Writer => writer;
static H6 IHtmlElement<H6>.Create(TextWriter writer) => new(writer);
static bool IHtmlElement<H6>.IsVoidElement => false;
static string IHtmlElement<H6>.Name => ElementName;
static ReadOnlySpan<string> IHtmlElement<H6>.SupportedAttributes => _supportedAttributes;
private static readonly string[] _supportedAttributes =
[
"accesskey",
"autocapitalize",
"class",
"contenteditable",
"dir",
"draggable",
"hidden",
"id",
"itemprop",
"lang",
"role",
"slot",
"spellcheck",
"style",
"tabindex",
"title",
"translate",
];
}
+44 -62
View File
@@ -4,7 +4,8 @@
namespace AssetRipper.Text.Html;
public readonly ref partial struct Head
public readonly ref partial struct Head : IHtmlElement<Head>,
IGlobalAttributes<Head>
{
private const string ElementName = "head";
private readonly TextWriter writer;
@@ -15,7 +16,7 @@ public readonly ref partial struct Head
writer.Write($"<{ElementName}");
}
public string? Accesskey
public string? AccessKey
{
set
{
@@ -25,9 +26,9 @@ public readonly ref partial struct Head
}
}
public Head WithAccesskey(string? value = null)
public Head WithAccessKey(string? value = null)
{
Accesskey = value;
AccessKey = value;
return this;
}
@@ -63,7 +64,7 @@ public readonly ref partial struct Head
return this;
}
public string? Contenteditable
public string? ContentEditable
{
set
{
@@ -73,25 +74,9 @@ public readonly ref partial struct Head
}
}
public Head WithContenteditable(string? value = null)
public Head WithContentEditable(string? value = null)
{
Contenteditable = value;
return this;
}
public string? Contextmenu
{
set
{
writer.Write(" contextmenu=\"");
writer.Write(value);
writer.Write('"');
}
}
public Head WithContextmenu(string? value = null)
{
Contextmenu = value;
ContentEditable = value;
return this;
}
@@ -159,7 +144,7 @@ public readonly ref partial struct Head
return this;
}
public string? Itemprop
public string? ItemProp
{
set
{
@@ -169,9 +154,9 @@ public readonly ref partial struct Head
}
}
public Head WithItemprop(string? value = null)
public Head WithItemProp(string? value = null)
{
Itemprop = value;
ItemProp = value;
return this;
}
@@ -223,7 +208,7 @@ public readonly ref partial struct Head
return this;
}
public string? Spellcheck
public string? SpellCheck
{
set
{
@@ -233,9 +218,9 @@ public readonly ref partial struct Head
}
}
public Head WithSpellcheck(string? value = null)
public Head WithSpellCheck(string? value = null)
{
Spellcheck = value;
SpellCheck = value;
return this;
}
@@ -255,7 +240,7 @@ public readonly ref partial struct Head
return this;
}
public string? Tabindex
public string? TabIndex
{
set
{
@@ -265,9 +250,9 @@ public readonly ref partial struct Head
}
}
public Head WithTabindex(string? value = null)
public Head WithTabIndex(string? value = null)
{
Tabindex = value;
TabIndex = value;
return this;
}
@@ -303,36 +288,6 @@ public readonly ref partial struct Head
return this;
}
public Head WithCustomAttribute(string key, string? value = null)
{
WriteKey(key);
WriteValue(value);
return this;
}
public Head WithCustomAttributes(scoped ReadOnlySpan<(string, string?)> attributes)
{
foreach ((string key, string? value) in attributes)
{
WriteKey(key);
WriteValue(value);
}
return this;
}
private void WriteKey(string key)
{
writer.Write(' ');
writer.Write(key);
}
private void WriteValue(string? value)
{
writer.Write("=\"");
writer.Write(value);
writer.Write('"');
}
public void Close() => writer.Write($"></{ElementName}>");
/// <summary>
@@ -353,4 +308,31 @@ public readonly ref partial struct Head
writer.Write('>');
return new HtmlElementCloser(writer, $"</{ElementName}>");
}
// IHtmlElement<TSelf> implementation
TextWriter IHtmlElement<Head>.Writer => writer;
static Head IHtmlElement<Head>.Create(TextWriter writer) => new(writer);
static bool IHtmlElement<Head>.IsVoidElement => false;
static string IHtmlElement<Head>.Name => ElementName;
static ReadOnlySpan<string> IHtmlElement<Head>.SupportedAttributes => _supportedAttributes;
private static readonly string[] _supportedAttributes =
[
"accesskey",
"autocapitalize",
"class",
"contenteditable",
"dir",
"draggable",
"hidden",
"id",
"itemprop",
"lang",
"role",
"slot",
"spellcheck",
"style",
"tabindex",
"title",
"translate",
];
}
+44 -62
View File
@@ -4,7 +4,8 @@
namespace AssetRipper.Text.Html;
public readonly ref partial struct Header
public readonly ref partial struct Header : IHtmlElement<Header>,
IGlobalAttributes<Header>
{
private const string ElementName = "header";
private readonly TextWriter writer;
@@ -15,7 +16,7 @@ public readonly ref partial struct Header
writer.Write($"<{ElementName}");
}
public string? Accesskey
public string? AccessKey
{
set
{
@@ -25,9 +26,9 @@ public readonly ref partial struct Header
}
}
public Header WithAccesskey(string? value = null)
public Header WithAccessKey(string? value = null)
{
Accesskey = value;
AccessKey = value;
return this;
}
@@ -63,7 +64,7 @@ public readonly ref partial struct Header
return this;
}
public string? Contenteditable
public string? ContentEditable
{
set
{
@@ -73,25 +74,9 @@ public readonly ref partial struct Header
}
}
public Header WithContenteditable(string? value = null)
public Header WithContentEditable(string? value = null)
{
Contenteditable = value;
return this;
}
public string? Contextmenu
{
set
{
writer.Write(" contextmenu=\"");
writer.Write(value);
writer.Write('"');
}
}
public Header WithContextmenu(string? value = null)
{
Contextmenu = value;
ContentEditable = value;
return this;
}
@@ -159,7 +144,7 @@ public readonly ref partial struct Header
return this;
}
public string? Itemprop
public string? ItemProp
{
set
{
@@ -169,9 +154,9 @@ public readonly ref partial struct Header
}
}
public Header WithItemprop(string? value = null)
public Header WithItemProp(string? value = null)
{
Itemprop = value;
ItemProp = value;
return this;
}
@@ -223,7 +208,7 @@ public readonly ref partial struct Header
return this;
}
public string? Spellcheck
public string? SpellCheck
{
set
{
@@ -233,9 +218,9 @@ public readonly ref partial struct Header
}
}
public Header WithSpellcheck(string? value = null)
public Header WithSpellCheck(string? value = null)
{
Spellcheck = value;
SpellCheck = value;
return this;
}
@@ -255,7 +240,7 @@ public readonly ref partial struct Header
return this;
}
public string? Tabindex
public string? TabIndex
{
set
{
@@ -265,9 +250,9 @@ public readonly ref partial struct Header
}
}
public Header WithTabindex(string? value = null)
public Header WithTabIndex(string? value = null)
{
Tabindex = value;
TabIndex = value;
return this;
}
@@ -303,36 +288,6 @@ public readonly ref partial struct Header
return this;
}
public Header WithCustomAttribute(string key, string? value = null)
{
WriteKey(key);
WriteValue(value);
return this;
}
public Header WithCustomAttributes(scoped ReadOnlySpan<(string, string?)> attributes)
{
foreach ((string key, string? value) in attributes)
{
WriteKey(key);
WriteValue(value);
}
return this;
}
private void WriteKey(string key)
{
writer.Write(' ');
writer.Write(key);
}
private void WriteValue(string? value)
{
writer.Write("=\"");
writer.Write(value);
writer.Write('"');
}
public void Close() => writer.Write($"></{ElementName}>");
/// <summary>
@@ -353,4 +308,31 @@ public readonly ref partial struct Header
writer.Write('>');
return new HtmlElementCloser(writer, $"</{ElementName}>");
}
// IHtmlElement<TSelf> implementation
TextWriter IHtmlElement<Header>.Writer => writer;
static Header IHtmlElement<Header>.Create(TextWriter writer) => new(writer);
static bool IHtmlElement<Header>.IsVoidElement => false;
static string IHtmlElement<Header>.Name => ElementName;
static ReadOnlySpan<string> IHtmlElement<Header>.SupportedAttributes => _supportedAttributes;
private static readonly string[] _supportedAttributes =
[
"accesskey",
"autocapitalize",
"class",
"contenteditable",
"dir",
"draggable",
"hidden",
"id",
"itemprop",
"lang",
"role",
"slot",
"spellcheck",
"style",
"tabindex",
"title",
"translate",
];
}
+44 -62
View File
@@ -4,7 +4,8 @@
namespace AssetRipper.Text.Html;
public readonly ref partial struct Hgroup
public readonly ref partial struct Hgroup : IHtmlElement<Hgroup>,
IGlobalAttributes<Hgroup>
{
private const string ElementName = "hgroup";
private readonly TextWriter writer;
@@ -15,7 +16,7 @@ public readonly ref partial struct Hgroup
writer.Write($"<{ElementName}");
}
public string? Accesskey
public string? AccessKey
{
set
{
@@ -25,9 +26,9 @@ public readonly ref partial struct Hgroup
}
}
public Hgroup WithAccesskey(string? value = null)
public Hgroup WithAccessKey(string? value = null)
{
Accesskey = value;
AccessKey = value;
return this;
}
@@ -63,7 +64,7 @@ public readonly ref partial struct Hgroup
return this;
}
public string? Contenteditable
public string? ContentEditable
{
set
{
@@ -73,25 +74,9 @@ public readonly ref partial struct Hgroup
}
}
public Hgroup WithContenteditable(string? value = null)
public Hgroup WithContentEditable(string? value = null)
{
Contenteditable = value;
return this;
}
public string? Contextmenu
{
set
{
writer.Write(" contextmenu=\"");
writer.Write(value);
writer.Write('"');
}
}
public Hgroup WithContextmenu(string? value = null)
{
Contextmenu = value;
ContentEditable = value;
return this;
}
@@ -159,7 +144,7 @@ public readonly ref partial struct Hgroup
return this;
}
public string? Itemprop
public string? ItemProp
{
set
{
@@ -169,9 +154,9 @@ public readonly ref partial struct Hgroup
}
}
public Hgroup WithItemprop(string? value = null)
public Hgroup WithItemProp(string? value = null)
{
Itemprop = value;
ItemProp = value;
return this;
}
@@ -223,7 +208,7 @@ public readonly ref partial struct Hgroup
return this;
}
public string? Spellcheck
public string? SpellCheck
{
set
{
@@ -233,9 +218,9 @@ public readonly ref partial struct Hgroup
}
}
public Hgroup WithSpellcheck(string? value = null)
public Hgroup WithSpellCheck(string? value = null)
{
Spellcheck = value;
SpellCheck = value;
return this;
}
@@ -255,7 +240,7 @@ public readonly ref partial struct Hgroup
return this;
}
public string? Tabindex
public string? TabIndex
{
set
{
@@ -265,9 +250,9 @@ public readonly ref partial struct Hgroup
}
}
public Hgroup WithTabindex(string? value = null)
public Hgroup WithTabIndex(string? value = null)
{
Tabindex = value;
TabIndex = value;
return this;
}
@@ -303,36 +288,6 @@ public readonly ref partial struct Hgroup
return this;
}
public Hgroup WithCustomAttribute(string key, string? value = null)
{
WriteKey(key);
WriteValue(value);
return this;
}
public Hgroup WithCustomAttributes(scoped ReadOnlySpan<(string, string?)> attributes)
{
foreach ((string key, string? value) in attributes)
{
WriteKey(key);
WriteValue(value);
}
return this;
}
private void WriteKey(string key)
{
writer.Write(' ');
writer.Write(key);
}
private void WriteValue(string? value)
{
writer.Write("=\"");
writer.Write(value);
writer.Write('"');
}
public void Close() => writer.Write($"></{ElementName}>");
/// <summary>
@@ -353,4 +308,31 @@ public readonly ref partial struct Hgroup
writer.Write('>');
return new HtmlElementCloser(writer, $"</{ElementName}>");
}
// IHtmlElement<TSelf> implementation
TextWriter IHtmlElement<Hgroup>.Writer => writer;
static Hgroup IHtmlElement<Hgroup>.Create(TextWriter writer) => new(writer);
static bool IHtmlElement<Hgroup>.IsVoidElement => false;
static string IHtmlElement<Hgroup>.Name => ElementName;
static ReadOnlySpan<string> IHtmlElement<Hgroup>.SupportedAttributes => _supportedAttributes;
private static readonly string[] _supportedAttributes =
[
"accesskey",
"autocapitalize",
"class",
"contenteditable",
"dir",
"draggable",
"hidden",
"id",
"itemprop",
"lang",
"role",
"slot",
"spellcheck",
"style",
"tabindex",
"title",
"translate",
];
}
+50 -62
View File
@@ -4,7 +4,10 @@
namespace AssetRipper.Text.Html;
public readonly ref partial struct Hr
public readonly ref partial struct Hr : IHtmlElement<Hr>,
IAlignAttribute<Hr>,
IColorAttribute<Hr>,
IGlobalAttributes<Hr>
{
private const string ElementName = "hr";
private readonly TextWriter writer;
@@ -15,7 +18,7 @@ public readonly ref partial struct Hr
writer.Write($"<{ElementName}");
}
public string? Accesskey
public string? AccessKey
{
set
{
@@ -25,9 +28,9 @@ public readonly ref partial struct Hr
}
}
public Hr WithAccesskey(string? value = null)
public Hr WithAccessKey(string? value = null)
{
Accesskey = value;
AccessKey = value;
return this;
}
@@ -95,7 +98,7 @@ public readonly ref partial struct Hr
return this;
}
public string? Contenteditable
public string? ContentEditable
{
set
{
@@ -105,25 +108,9 @@ public readonly ref partial struct Hr
}
}
public Hr WithContenteditable(string? value = null)
public Hr WithContentEditable(string? value = null)
{
Contenteditable = value;
return this;
}
public string? Contextmenu
{
set
{
writer.Write(" contextmenu=\"");
writer.Write(value);
writer.Write('"');
}
}
public Hr WithContextmenu(string? value = null)
{
Contextmenu = value;
ContentEditable = value;
return this;
}
@@ -191,7 +178,7 @@ public readonly ref partial struct Hr
return this;
}
public string? Itemprop
public string? ItemProp
{
set
{
@@ -201,9 +188,9 @@ public readonly ref partial struct Hr
}
}
public Hr WithItemprop(string? value = null)
public Hr WithItemProp(string? value = null)
{
Itemprop = value;
ItemProp = value;
return this;
}
@@ -255,7 +242,7 @@ public readonly ref partial struct Hr
return this;
}
public string? Spellcheck
public string? SpellCheck
{
set
{
@@ -265,9 +252,9 @@ public readonly ref partial struct Hr
}
}
public Hr WithSpellcheck(string? value = null)
public Hr WithSpellCheck(string? value = null)
{
Spellcheck = value;
SpellCheck = value;
return this;
}
@@ -287,7 +274,7 @@ public readonly ref partial struct Hr
return this;
}
public string? Tabindex
public string? TabIndex
{
set
{
@@ -297,9 +284,9 @@ public readonly ref partial struct Hr
}
}
public Hr WithTabindex(string? value = null)
public Hr WithTabIndex(string? value = null)
{
Tabindex = value;
TabIndex = value;
return this;
}
@@ -335,35 +322,36 @@ public readonly ref partial struct Hr
return this;
}
public Hr WithCustomAttribute(string key, string? value = null)
{
WriteKey(key);
WriteValue(value);
return this;
}
public Hr WithCustomAttributes(scoped ReadOnlySpan<(string, string?)> attributes)
{
foreach ((string key, string? value) in attributes)
{
WriteKey(key);
WriteValue(value);
}
return this;
}
private void WriteKey(string key)
{
writer.Write(' ');
writer.Write(key);
}
private void WriteValue(string? value)
{
writer.Write("=\"");
writer.Write(value);
writer.Write('"');
}
public void Close() => writer.Write("/>");
HtmlElementCloser IHtmlElement<Hr>.End() => throw new NotSupportedException();
// IHtmlElement<TSelf> implementation
TextWriter IHtmlElement<Hr>.Writer => writer;
static Hr IHtmlElement<Hr>.Create(TextWriter writer) => new(writer);
static bool IHtmlElement<Hr>.IsVoidElement => true;
static string IHtmlElement<Hr>.Name => ElementName;
static ReadOnlySpan<string> IHtmlElement<Hr>.SupportedAttributes => _supportedAttributes;
private static readonly string[] _supportedAttributes =
[
"accesskey",
"align",
"autocapitalize",
"class",
"color",
"contenteditable",
"dir",
"draggable",
"hidden",
"id",
"itemprop",
"lang",
"role",
"slot",
"spellcheck",
"style",
"tabindex",
"title",
"translate",
];
}
+44 -78
View File
@@ -4,7 +4,8 @@
namespace AssetRipper.Text.Html;
public readonly ref partial struct Html
public readonly ref partial struct Html : IHtmlElement<Html>,
IGlobalAttributes<Html>
{
private const string ElementName = "html";
private readonly TextWriter writer;
@@ -15,7 +16,7 @@ public readonly ref partial struct Html
writer.Write($"<{ElementName}");
}
public string? Accesskey
public string? AccessKey
{
set
{
@@ -25,9 +26,9 @@ public readonly ref partial struct Html
}
}
public Html WithAccesskey(string? value = null)
public Html WithAccessKey(string? value = null)
{
Accesskey = value;
AccessKey = value;
return this;
}
@@ -63,7 +64,7 @@ public readonly ref partial struct Html
return this;
}
public string? Contenteditable
public string? ContentEditable
{
set
{
@@ -73,25 +74,9 @@ public readonly ref partial struct Html
}
}
public Html WithContenteditable(string? value = null)
public Html WithContentEditable(string? value = null)
{
Contenteditable = value;
return this;
}
public string? Contextmenu
{
set
{
writer.Write(" contextmenu=\"");
writer.Write(value);
writer.Write('"');
}
}
public Html WithContextmenu(string? value = null)
{
Contextmenu = value;
ContentEditable = value;
return this;
}
@@ -159,7 +144,7 @@ public readonly ref partial struct Html
return this;
}
public string? Itemprop
public string? ItemProp
{
set
{
@@ -169,9 +154,9 @@ public readonly ref partial struct Html
}
}
public Html WithItemprop(string? value = null)
public Html WithItemProp(string? value = null)
{
Itemprop = value;
ItemProp = value;
return this;
}
@@ -191,22 +176,6 @@ public readonly ref partial struct Html
return this;
}
public string? Manifest
{
set
{
writer.Write(" manifest=\"");
writer.Write(value);
writer.Write('"');
}
}
public Html WithManifest(string? value = null)
{
Manifest = value;
return this;
}
public string? Role
{
set
@@ -239,7 +208,7 @@ public readonly ref partial struct Html
return this;
}
public string? Spellcheck
public string? SpellCheck
{
set
{
@@ -249,9 +218,9 @@ public readonly ref partial struct Html
}
}
public Html WithSpellcheck(string? value = null)
public Html WithSpellCheck(string? value = null)
{
Spellcheck = value;
SpellCheck = value;
return this;
}
@@ -271,7 +240,7 @@ public readonly ref partial struct Html
return this;
}
public string? Tabindex
public string? TabIndex
{
set
{
@@ -281,9 +250,9 @@ public readonly ref partial struct Html
}
}
public Html WithTabindex(string? value = null)
public Html WithTabIndex(string? value = null)
{
Tabindex = value;
TabIndex = value;
return this;
}
@@ -319,36 +288,6 @@ public readonly ref partial struct Html
return this;
}
public Html WithCustomAttribute(string key, string? value = null)
{
WriteKey(key);
WriteValue(value);
return this;
}
public Html WithCustomAttributes(scoped ReadOnlySpan<(string, string?)> attributes)
{
foreach ((string key, string? value) in attributes)
{
WriteKey(key);
WriteValue(value);
}
return this;
}
private void WriteKey(string key)
{
writer.Write(' ');
writer.Write(key);
}
private void WriteValue(string? value)
{
writer.Write("=\"");
writer.Write(value);
writer.Write('"');
}
public void Close() => writer.Write($"></{ElementName}>");
/// <summary>
@@ -369,4 +308,31 @@ public readonly ref partial struct Html
writer.Write('>');
return new HtmlElementCloser(writer, $"</{ElementName}>");
}
// IHtmlElement<TSelf> implementation
TextWriter IHtmlElement<Html>.Writer => writer;
static Html IHtmlElement<Html>.Create(TextWriter writer) => new(writer);
static bool IHtmlElement<Html>.IsVoidElement => false;
static string IHtmlElement<Html>.Name => ElementName;
static ReadOnlySpan<string> IHtmlElement<Html>.SupportedAttributes => _supportedAttributes;
private static readonly string[] _supportedAttributes =
[
"accesskey",
"autocapitalize",
"class",
"contenteditable",
"dir",
"draggable",
"hidden",
"id",
"itemprop",
"lang",
"role",
"slot",
"spellcheck",
"style",
"tabindex",
"title",
"translate",
];
}
+44 -62
View File
@@ -4,7 +4,8 @@
namespace AssetRipper.Text.Html;
public readonly ref partial struct I
public readonly ref partial struct I : IHtmlElement<I>,
IGlobalAttributes<I>
{
private const string ElementName = "i";
private readonly TextWriter writer;
@@ -15,7 +16,7 @@ public readonly ref partial struct I
writer.Write($"<{ElementName}");
}
public string? Accesskey
public string? AccessKey
{
set
{
@@ -25,9 +26,9 @@ public readonly ref partial struct I
}
}
public I WithAccesskey(string? value = null)
public I WithAccessKey(string? value = null)
{
Accesskey = value;
AccessKey = value;
return this;
}
@@ -63,7 +64,7 @@ public readonly ref partial struct I
return this;
}
public string? Contenteditable
public string? ContentEditable
{
set
{
@@ -73,25 +74,9 @@ public readonly ref partial struct I
}
}
public I WithContenteditable(string? value = null)
public I WithContentEditable(string? value = null)
{
Contenteditable = value;
return this;
}
public string? Contextmenu
{
set
{
writer.Write(" contextmenu=\"");
writer.Write(value);
writer.Write('"');
}
}
public I WithContextmenu(string? value = null)
{
Contextmenu = value;
ContentEditable = value;
return this;
}
@@ -159,7 +144,7 @@ public readonly ref partial struct I
return this;
}
public string? Itemprop
public string? ItemProp
{
set
{
@@ -169,9 +154,9 @@ public readonly ref partial struct I
}
}
public I WithItemprop(string? value = null)
public I WithItemProp(string? value = null)
{
Itemprop = value;
ItemProp = value;
return this;
}
@@ -223,7 +208,7 @@ public readonly ref partial struct I
return this;
}
public string? Spellcheck
public string? SpellCheck
{
set
{
@@ -233,9 +218,9 @@ public readonly ref partial struct I
}
}
public I WithSpellcheck(string? value = null)
public I WithSpellCheck(string? value = null)
{
Spellcheck = value;
SpellCheck = value;
return this;
}
@@ -255,7 +240,7 @@ public readonly ref partial struct I
return this;
}
public string? Tabindex
public string? TabIndex
{
set
{
@@ -265,9 +250,9 @@ public readonly ref partial struct I
}
}
public I WithTabindex(string? value = null)
public I WithTabIndex(string? value = null)
{
Tabindex = value;
TabIndex = value;
return this;
}
@@ -303,36 +288,6 @@ public readonly ref partial struct I
return this;
}
public I WithCustomAttribute(string key, string? value = null)
{
WriteKey(key);
WriteValue(value);
return this;
}
public I WithCustomAttributes(scoped ReadOnlySpan<(string, string?)> attributes)
{
foreach ((string key, string? value) in attributes)
{
WriteKey(key);
WriteValue(value);
}
return this;
}
private void WriteKey(string key)
{
writer.Write(' ');
writer.Write(key);
}
private void WriteValue(string? value)
{
writer.Write("=\"");
writer.Write(value);
writer.Write('"');
}
public void Close() => writer.Write($"></{ElementName}>");
/// <summary>
@@ -353,4 +308,31 @@ public readonly ref partial struct I
writer.Write('>');
return new HtmlElementCloser(writer, $"</{ElementName}>");
}
// IHtmlElement<TSelf> implementation
TextWriter IHtmlElement<I>.Writer => writer;
static I IHtmlElement<I>.Create(TextWriter writer) => new(writer);
static bool IHtmlElement<I>.IsVoidElement => false;
static string IHtmlElement<I>.Name => ElementName;
static ReadOnlySpan<string> IHtmlElement<I>.SupportedAttributes => _supportedAttributes;
private static readonly string[] _supportedAttributes =
[
"accesskey",
"autocapitalize",
"class",
"contenteditable",
"dir",
"draggable",
"hidden",
"id",
"itemprop",
"lang",
"role",
"slot",
"spellcheck",
"style",
"tabindex",
"title",
"translate",
];
}
@@ -0,0 +1,12 @@
// Auto-generated code. Do not modify manually.
#nullable enable
namespace AssetRipper.Text.Html;
public interface IAcceptAttribute<TSelf> where TSelf : IAcceptAttribute<TSelf>, allows ref struct
{
string Accept { set; }
TSelf WithAccept(string? value = null);
}
@@ -0,0 +1,12 @@
// Auto-generated code. Do not modify manually.
#nullable enable
namespace AssetRipper.Text.Html;
public interface IAcceptCharsetAttribute<TSelf> where TSelf : IAcceptCharsetAttribute<TSelf>, allows ref struct
{
string AcceptCharset { set; }
TSelf WithAcceptCharset(string? value = null);
}
@@ -0,0 +1,12 @@
// Auto-generated code. Do not modify manually.
#nullable enable
namespace AssetRipper.Text.Html;
public interface IActionAttribute<TSelf> where TSelf : IActionAttribute<TSelf>, allows ref struct
{
string Action { set; }
TSelf WithAction(string? value = null);
}
@@ -0,0 +1,12 @@
// Auto-generated code. Do not modify manually.
#nullable enable
namespace AssetRipper.Text.Html;
public interface IAlignAttribute<TSelf> where TSelf : IAlignAttribute<TSelf>, allows ref struct
{
string Align { set; }
TSelf WithAlign(string? value = null);
}
@@ -0,0 +1,12 @@
// Auto-generated code. Do not modify manually.
#nullable enable
namespace AssetRipper.Text.Html;
public interface IAllowAttribute<TSelf> where TSelf : IAllowAttribute<TSelf>, allows ref struct
{
string Allow { set; }
TSelf WithAllow(string? value = null);
}
@@ -0,0 +1,12 @@
// Auto-generated code. Do not modify manually.
#nullable enable
namespace AssetRipper.Text.Html;
public interface IAltAttribute<TSelf> where TSelf : IAltAttribute<TSelf>, allows ref struct
{
string Alt { set; }
TSelf WithAlt(string? value = null);
}
@@ -0,0 +1,12 @@
// Auto-generated code. Do not modify manually.
#nullable enable
namespace AssetRipper.Text.Html;
public interface IAsAttribute<TSelf> where TSelf : IAsAttribute<TSelf>, allows ref struct
{
string As { set; }
TSelf WithAs(string? value = null);
}
@@ -0,0 +1,12 @@
// Auto-generated code. Do not modify manually.
#nullable enable
namespace AssetRipper.Text.Html;
public interface IAsyncAttribute<TSelf> where TSelf : IAsyncAttribute<TSelf>, allows ref struct
{
string Async { set; }
TSelf WithAsync(string? value = null);
}
@@ -0,0 +1,12 @@
// Auto-generated code. Do not modify manually.
#nullable enable
namespace AssetRipper.Text.Html;
public interface IAutocompleteAttribute<TSelf> where TSelf : IAutocompleteAttribute<TSelf>, allows ref struct
{
string Autocomplete { set; }
TSelf WithAutocomplete(string? value = null);
}
@@ -0,0 +1,12 @@
// Auto-generated code. Do not modify manually.
#nullable enable
namespace AssetRipper.Text.Html;
public interface IAutoplayAttribute<TSelf> where TSelf : IAutoplayAttribute<TSelf>, allows ref struct
{
string Autoplay { set; }
TSelf WithAutoplay(string? value = null);
}
@@ -0,0 +1,12 @@
// Auto-generated code. Do not modify manually.
#nullable enable
namespace AssetRipper.Text.Html;
public interface IBackgroundAttribute<TSelf> where TSelf : IBackgroundAttribute<TSelf>, allows ref struct
{
string Background { set; }
TSelf WithBackground(string? value = null);
}
@@ -0,0 +1,12 @@
// Auto-generated code. Do not modify manually.
#nullable enable
namespace AssetRipper.Text.Html;
public interface IBgColorAttribute<TSelf> where TSelf : IBgColorAttribute<TSelf>, allows ref struct
{
string BgColor { set; }
TSelf WithBgColor(string? value = null);
}
@@ -0,0 +1,12 @@
// Auto-generated code. Do not modify manually.
#nullable enable
namespace AssetRipper.Text.Html;
public interface IBorderAttribute<TSelf> where TSelf : IBorderAttribute<TSelf>, allows ref struct
{
string Border { set; }
TSelf WithBorder(string? value = null);
}
@@ -0,0 +1,12 @@
// Auto-generated code. Do not modify manually.
#nullable enable
namespace AssetRipper.Text.Html;
public interface ICaptureAttribute<TSelf> where TSelf : ICaptureAttribute<TSelf>, allows ref struct
{
string Capture { set; }
TSelf WithCapture(string? value = null);
}
@@ -0,0 +1,12 @@
// Auto-generated code. Do not modify manually.
#nullable enable
namespace AssetRipper.Text.Html;
public interface ICharsetAttribute<TSelf> where TSelf : ICharsetAttribute<TSelf>, allows ref struct
{
string Charset { set; }
TSelf WithCharset(string? value = null);
}
@@ -0,0 +1,12 @@
// Auto-generated code. Do not modify manually.
#nullable enable
namespace AssetRipper.Text.Html;
public interface ICheckedAttribute<TSelf> where TSelf : ICheckedAttribute<TSelf>, allows ref struct
{
string Checked { set; }
TSelf WithChecked(string? value = null);
}
@@ -0,0 +1,12 @@
// Auto-generated code. Do not modify manually.
#nullable enable
namespace AssetRipper.Text.Html;
public interface ICiteAttribute<TSelf> where TSelf : ICiteAttribute<TSelf>, allows ref struct
{
string Cite { set; }
TSelf WithCite(string? value = null);
}
@@ -0,0 +1,12 @@
// Auto-generated code. Do not modify manually.
#nullable enable
namespace AssetRipper.Text.Html;
public interface IColSpanAttribute<TSelf> where TSelf : IColSpanAttribute<TSelf>, allows ref struct
{
string ColSpan { set; }
TSelf WithColSpan(string? value = null);
}
@@ -0,0 +1,12 @@
// Auto-generated code. Do not modify manually.
#nullable enable
namespace AssetRipper.Text.Html;
public interface IColorAttribute<TSelf> where TSelf : IColorAttribute<TSelf>, allows ref struct
{
string Color { set; }
TSelf WithColor(string? value = null);
}
@@ -0,0 +1,12 @@
// Auto-generated code. Do not modify manually.
#nullable enable
namespace AssetRipper.Text.Html;
public interface IColsAttribute<TSelf> where TSelf : IColsAttribute<TSelf>, allows ref struct
{
string Cols { set; }
TSelf WithCols(string? value = null);
}
@@ -0,0 +1,12 @@
// Auto-generated code. Do not modify manually.
#nullable enable
namespace AssetRipper.Text.Html;
public interface IContentAttribute<TSelf> where TSelf : IContentAttribute<TSelf>, allows ref struct
{
string Content { set; }
TSelf WithContent(string? value = null);
}
@@ -0,0 +1,12 @@
// Auto-generated code. Do not modify manually.
#nullable enable
namespace AssetRipper.Text.Html;
public interface IControlsAttribute<TSelf> where TSelf : IControlsAttribute<TSelf>, allows ref struct
{
string Controls { set; }
TSelf WithControls(string? value = null);
}
@@ -0,0 +1,12 @@
// Auto-generated code. Do not modify manually.
#nullable enable
namespace AssetRipper.Text.Html;
public interface ICoordsAttribute<TSelf> where TSelf : ICoordsAttribute<TSelf>, allows ref struct
{
string Coords { set; }
TSelf WithCoords(string? value = null);
}
@@ -0,0 +1,12 @@
// Auto-generated code. Do not modify manually.
#nullable enable
namespace AssetRipper.Text.Html;
public interface ICrossOriginAttribute<TSelf> where TSelf : ICrossOriginAttribute<TSelf>, allows ref struct
{
string CrossOrigin { set; }
TSelf WithCrossOrigin(string? value = null);
}
@@ -0,0 +1,12 @@
// Auto-generated code. Do not modify manually.
#nullable enable
namespace AssetRipper.Text.Html;
public interface ICspAttribute<TSelf> where TSelf : ICspAttribute<TSelf>, allows ref struct
{
string Csp { set; }
TSelf WithCsp(string? value = null);
}
Loaded 100 of 266 files, more files were not shown because too many files have changed in this diff. Show more