Skip to content

Commit 89a8c3f

Browse files
committed
Updated to 0.14
1 parent 737d86a commit 89a8c3f

File tree

4 files changed

+40
-69
lines changed

4 files changed

+40
-69
lines changed

src/AngleSharp.Xml.Tests/AngleSharp.Xml.Tests.csproj

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,13 @@
1313
</ItemGroup>
1414

1515
<ItemGroup>
16-
<PackageReference Include="Newtonsoft.Json" Version="12.0.1" />
17-
<PackageReference Include="NUnit" Version="3.11.0" />
18-
<PackageReference Include="NUnit3TestAdapter" Version="3.11.0" />
16+
<PackageReference Include="AngleSharp" Version="0.14.0" />
17+
<PackageReference Include="Newtonsoft.Json" Version="12.0.3" />
18+
<PackageReference Include="NUnit" Version="3.12.0" />
19+
<PackageReference Include="NUnit3TestAdapter" Version="3.16.1">
20+
<PrivateAssets>all</PrivateAssets>
21+
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
22+
</PackageReference>
1923
<PackageReference Include="Appveyor.TestLogger" Version="2.0.0" />
2024
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.9.0" />
2125
</ItemGroup>

src/AngleSharp.Xml/AngleSharp.Xml.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
</PropertyGroup>
1010

1111
<ItemGroup>
12-
<PackageReference Include="AngleSharp" Version="0.14.0-alpha-784" />
12+
<PackageReference Include="AngleSharp" Version="0.14.0" />
1313
</ItemGroup>
1414

1515
<PropertyGroup Condition=" '$(OS)' == 'Windows_NT' ">

src/AngleSharp.Xml/AutoSelectedMarkupFormatter.cs

Lines changed: 15 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ namespace AngleSharp.Xml
99
/// AutoSelectedMarkupFormatter class to select the proper MarkupFormatter
1010
/// implementation depending on the used document type.
1111
/// </summary>
12-
public sealed class AutoSelectedMarkupFormatter : IMarkupFormatter
12+
public class AutoSelectedMarkupFormatter : IMarkupFormatter
1313
{
1414
#region Fields
1515

@@ -60,86 +60,46 @@ private IMarkupFormatter ChildFormatter
6060

6161
#region Methods
6262

63-
/// <summary>
64-
/// Formats an attribute specified by the argument.
65-
/// </summary>
66-
/// <param name="attribute">The attribute to serialize.</param>
67-
/// <returns>The formatted attribute.</returns>
68-
public String Attribute(IAttr attribute) => ChildFormatter.Attribute(attribute);
69-
70-
/// <summary>
71-
/// Formats opening a tag with the given name.
72-
/// </summary>
73-
/// <param name="element">The element to open.</param>
74-
/// <param name="selfClosing">
75-
/// Is the element actually self-closing?
76-
/// </param>
77-
/// <returns>The formatted opening tag.</returns>
78-
public String OpenTag(IElement element, Boolean selfClosing)
63+
/// <inheritdoc />
64+
public virtual String OpenTag(IElement element, Boolean selfClosing)
7965
{
8066
Confirm(element.Owner.Doctype);
8167
return ChildFormatter.OpenTag(element, selfClosing);
8268
}
8369

84-
/// <summary>
85-
/// Formats closing a tag with the given name.
86-
/// </summary>
87-
/// <param name="element">The element to close.</param>
88-
/// <param name="selfClosing">
89-
/// Is the element actually self-closing?
90-
/// </param>
91-
/// <returns>The formatted closing tag.</returns>
92-
public String CloseTag(IElement element, Boolean selfClosing)
70+
/// <inheritdoc />
71+
public virtual String CloseTag(IElement element, Boolean selfClosing)
9372
{
9473
Confirm(element.Owner.Doctype);
9574
return ChildFormatter.CloseTag(element, selfClosing);
9675
}
9776

98-
/// <summary>
99-
/// Formats the given comment.
100-
/// </summary>
101-
/// <param name="comment">The comment to stringify.</param>
102-
/// <returns>The formatted comment.</returns>
103-
public String Comment(IComment comment)
77+
/// <inheritdoc />
78+
public virtual String Comment(IComment comment)
10479
{
10580
Confirm(comment.Owner.Doctype);
10681
return ChildFormatter.Comment(comment);
10782
}
10883

109-
/// <summary>
110-
/// Formats the given doctype using the name, public and system
111-
/// identifiers.
112-
/// </summary>
113-
/// <param name="doctype">The document type to stringify.</param>
114-
/// <returns>The formatted doctype.</returns>
115-
public String Doctype(IDocumentType doctype)
84+
/// <inheritdoc />
85+
public virtual String Doctype(IDocumentType doctype)
11686
{
11787
Confirm(doctype);
11888
return ChildFormatter.Doctype(doctype);
11989
}
12090

121-
/// <summary>
122-
/// Formats the given processing instruction using the target and the
123-
/// data.
124-
/// </summary>
125-
/// <param name="processing">
126-
/// The processing instruction to stringify.
127-
/// </param>
128-
/// <returns>The formatted processing instruction.</returns>
129-
public String Processing(IProcessingInstruction processing)
91+
/// <inheritdoc />
92+
public virtual String Processing(IProcessingInstruction processing)
13093
{
13194
Confirm(processing.Owner.Doctype);
13295
return ChildFormatter.Processing(processing);
13396
}
13497

135-
/// <summary>
136-
/// Formats the given text.
137-
/// </summary>
138-
/// <param name="text">The text to sanatize.</param>
139-
/// <returns>The formatted text.</returns>
140-
public String Text(ICharacterData text) => ChildFormatter.Text(text);
98+
/// <inheritdoc />
99+
public virtual String Text(ICharacterData text) => ChildFormatter.Text(text);
141100

142-
String IMarkupFormatter.LiteralText(ICharacterData text) => ChildFormatter.LiteralText(text);
101+
/// <inheritdoc />
102+
public virtual String LiteralText(ICharacterData text) => ChildFormatter.LiteralText(text);
143103

144104
#endregion
145105

src/AngleSharp.Xml/XmlMarkupFormatter.cs

Lines changed: 17 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ namespace AngleSharp.Xml
77
/// <summary>
88
/// Represents the standard XML markup formatter.
99
/// </summary>
10-
public sealed class XmlMarkupFormatter : IMarkupFormatter
10+
public class XmlMarkupFormatter : IMarkupFormatter
1111
{
1212
#region Instance
1313

@@ -30,7 +30,8 @@ public sealed class XmlMarkupFormatter : IMarkupFormatter
3030

3131
#region Methods
3232

33-
String IMarkupFormatter.CloseTag(IElement element, Boolean selfClosing)
33+
/// <inheritdoc />
34+
public virtual String CloseTag(IElement element, Boolean selfClosing)
3435
{
3536
var prefix = element.Prefix;
3637
var name = element.LocalName;
@@ -39,9 +40,11 @@ String IMarkupFormatter.CloseTag(IElement element, Boolean selfClosing)
3940
return closed ? String.Empty : String.Concat("</", tag, ">");
4041
}
4142

42-
String IMarkupFormatter.Comment(IComment comment) => String.Concat("<!--", comment.Data, "-->");
43+
/// <inheritdoc />
44+
public virtual String Comment(IComment comment) => String.Concat("<!--", comment.Data, "-->");
4345

44-
String IMarkupFormatter.Doctype(IDocumentType doctype)
46+
/// <inheritdoc />
47+
public virtual String Doctype(IDocumentType doctype)
4548
{
4649
var publicId = doctype.PublicIdentifier;
4750
var systemId = doctype.SystemIdentifier;
@@ -52,7 +55,8 @@ String IMarkupFormatter.Doctype(IDocumentType doctype)
5255
return String.Concat("<!DOCTYPE ", doctype.Name, externalId, ">");
5356
}
5457

55-
String IMarkupFormatter.OpenTag(IElement element, Boolean selfClosing)
58+
/// <inheritdoc />
59+
public virtual String OpenTag(IElement element, Boolean selfClosing)
5660
{
5761
var prefix = element.Prefix;
5862
var temp = StringBuilderPool.Obtain();
@@ -67,7 +71,7 @@ String IMarkupFormatter.OpenTag(IElement element, Boolean selfClosing)
6771

6872
foreach (var attribute in element.Attributes)
6973
{
70-
temp.Append(" ").Append(Instance.Attribute(attribute));
74+
temp.Append(" ").Append(Attribute(attribute));
7175
}
7276

7377
if (selfClosing || (IsAlwaysSelfClosing && !element.HasChildNodes))
@@ -79,21 +83,24 @@ String IMarkupFormatter.OpenTag(IElement element, Boolean selfClosing)
7983
return temp.ToPool();
8084
}
8185

82-
String IMarkupFormatter.Processing(IProcessingInstruction processing)
86+
/// <inheritdoc />
87+
public virtual String Processing(IProcessingInstruction processing)
8388
{
8489
var value = String.Concat(processing.Target, " ", processing.Data);
8590
return String.Concat("<?", value, "?>");
8691
}
8792

88-
String IMarkupFormatter.LiteralText(ICharacterData text) => text.Data;
93+
/// <inheritdoc />
94+
public virtual String LiteralText(ICharacterData text) => text.Data;
8995

90-
String IMarkupFormatter.Text(ICharacterData text)
96+
/// <inheritdoc />
97+
public virtual String Text(ICharacterData text)
9198
{
9299
var content = text.Data;
93100
return EscapeText(content);
94101
}
95102

96-
String IMarkupFormatter.Attribute(IAttr attribute)
103+
private String Attribute(IAttr attribute)
97104
{
98105
var value = attribute.Value;
99106
var temp = StringBuilderPool.Obtain();

0 commit comments

Comments
 (0)