Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net8.0</TargetFramework>
<TargetFramework>net10.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="AngleSharp" Version="1.0.7" />
<PackageReference Include="AngleSharp" Version="1.6.0" />
<PackageReference Include="AngleSharp.Io" Version="1.0.0" />
<PackageReference Include="AngleSharp.Js" Version="0.15.0" />
</ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -177,9 +177,7 @@
{
var booksCatalogUrl = "https://books.toscrape.com/";

var config = Configuration.Default
.WithDefaultLoader()
.WithJs();
var config = Configuration.Default.WithDefaultLoader();
var context = BrowsingContext.New(config);

var document = await context.OpenAsync(new Url(booksCatalogUrl));
Expand All @@ -200,19 +198,13 @@
[Fact]
public async Task WhenParsingHtmlFromString_ThenDocumentIsCreatedAndDomManipulationChangesDomAsExpected()
{
var config = Configuration.Default
.WithDefaultLoader()
.WithJs();

var context = BrowsingContext.New(config);
var context = BrowsingContext.New(Configuration.Default);
var document = await context.OpenAsync(req => req.Content(Html));

var paragraphElement = document.CreateElement("p");

paragraphElement = document.CreateElement<IHtmlParagraphElement>();
var paragraphElement = document.CreateElement<IHtmlParagraphElement>();
paragraphElement.TextContent = "This is a new paragraph.";

document.Body.AppendChild(paragraphElement);

Check warning on line 207 in dotnet-client-libraries/ParsingHtmlWithAngleSharp/Tests/ParsingHtmlWithAngleSharpUnitTests.cs

View workflow job for this annotation

GitHub Actions / Build & test (dotnet-client-libraries/ParsingHtmlWithAngleSharp)

Dereference of a possibly null reference.

Check warning on line 207 in dotnet-client-libraries/ParsingHtmlWithAngleSharp/Tests/ParsingHtmlWithAngleSharpUnitTests.cs

View workflow job for this annotation

GitHub Actions / Build & test (dotnet-client-libraries/ParsingHtmlWithAngleSharp)

Dereference of a possibly null reference.

Assert.IsAssignableFrom<IHtmlParagraphElement>(document.Body.Children[^1]);

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<TargetFramework>net10.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>

Expand Down
Loading