From a41b4de97b46bba058f29e99cd4c73cf8f7c6b20 Mon Sep 17 00:00:00 2001 From: Florian Rappl Date: Thu, 25 Nov 2021 22:44:59 +0100 Subject: [PATCH 1/3] Updated CI/CD --- .github/workflows/ci.yml | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e224ca8..810411b 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -49,6 +49,13 @@ jobs: steps: - uses: actions/checkout@v2 + + - uses: actions/setup-dotnet@v1 + with: + dotnet-version: | + 3.1.x + 5.0.x + 6.0.x - name: Build run: ./build.sh @@ -58,6 +65,13 @@ jobs: steps: - uses: actions/checkout@v2 + + - uses: actions/setup-dotnet@v1 + with: + dotnet-version: | + 3.1.x + 5.0.x + 6.0.x - name: Build run: | From 30eb2fec816b21c757d54d0e01f93fdb58bc8a8a Mon Sep 17 00:00:00 2001 From: Florian Rappl Date: Thu, 25 Nov 2021 22:57:30 +0100 Subject: [PATCH 2/3] Updated framework --- src/AngleSharp.Xml.Tests/AngleSharp.Xml.Tests.csproj | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/AngleSharp.Xml.Tests/AngleSharp.Xml.Tests.csproj b/src/AngleSharp.Xml.Tests/AngleSharp.Xml.Tests.csproj index 0b3a6e9..1f8eb84 100644 --- a/src/AngleSharp.Xml.Tests/AngleSharp.Xml.Tests.csproj +++ b/src/AngleSharp.Xml.Tests/AngleSharp.Xml.Tests.csproj @@ -1,6 +1,6 @@  - netcoreapp2.1 + netcoreapp3.1 true Key.snk false @@ -18,8 +18,8 @@ - + - + - \ No newline at end of file + From 7ab9773fdd386bca2a6fcb5b30cab4d433dbc904 Mon Sep 17 00:00:00 2001 From: Florian Rappl Date: Tue, 31 May 2022 22:27:59 +0200 Subject: [PATCH 3/3] Updated to use AngleSharp 0.17 --- .github/CONTRIBUTING.md | 8 ++++---- CHANGELOG.md | 8 ++++++++ LICENSE | 2 +- README.md | 4 ++-- build.cake | 1 - src/AngleSharp.Xml.Docs/package.json | 2 +- src/AngleSharp.Xml.Tests/AngleSharp.Xml.Tests.csproj | 10 +++++----- src/AngleSharp.Xml.nuspec | 6 +++--- src/AngleSharp.Xml/AngleSharp.Xml.csproj | 4 ++-- src/AngleSharp.Xml/Parser/Tokens/XmlTagToken.cs | 5 +++-- src/AngleSharp.Xml/Parser/XmlDomBuilder.cs | 9 +++++++-- src/Directory.Build.props | 2 +- tools/anglesharp.cake | 5 ++--- 13 files changed, 39 insertions(+), 27 deletions(-) diff --git a/.github/CONTRIBUTING.md b/.github/CONTRIBUTING.md index c3cc16d..cfe3834 100644 --- a/.github/CONTRIBUTING.md +++ b/.github/CONTRIBUTING.md @@ -64,7 +64,7 @@ There are a couple of rules, which are definitely not standard, but highly recom 1. If no issue already exists for the work you'll be doing, create one to document the problem(s) being solved and self-assign. 2. Otherwise please let us know that you are working on the problem. Regular status updates (e.g. "still in progress", "no time anymore", "practically done", "pull request issued") are highly welcome. -3. Create a new branch—please don't work in the `master` branch directly. It is reserved for releases. We recommend naming the branch to match the issue being addressed (`feature/#777` or `issue-777`). +3. Create a new branch—please don't work in the `main` branch directly. It is reserved for releases. We recommend naming the branch to match the issue being addressed (`feature/#777` or `issue-777`). 4. Add failing tests for the change you want to make. Tests are crucial and should be taken from W3C (or other specification). 5. Fix stuff. Always go from edge case to edge case. 6. All tests should pass now. Also your new implementation should not break existing tests. @@ -73,7 +73,7 @@ There are a couple of rules, which are definitely not standard, but highly recom Just to illustrate the git workflow for AngleSharp a little bit more we've added the following graphs. -Initially, AngleSharp starts at the `master` branch. This branch should contain the latest stable (or released) version. +Initially, AngleSharp starts at the `main` branch. This branch should contain the latest stable (or released) version. Here we now created a new branch called `devel`. This is the development branch. @@ -101,7 +101,7 @@ git push Finally, we may have all the features that are needed to release a new version of AngleSharp. Here we tag the release. For instance for the 1.0 release we use `v1.0`. ```sh -git checkout master +git checkout main git merge devel git tag v1.0 ``` @@ -128,7 +128,7 @@ To sync manually: ```sh git remote add gitbase git@github.com:AngleSharp/AngleSharp.GitBase.git -git pull gitbase master +git pull gitbase main ``` ### Versioning diff --git a/CHANGELOG.md b/CHANGELOG.md index b871a74..0564675 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,11 @@ +# 0.17.0 + +Released on Tuesday, May 31 2022. + +- Updated to use AngleSharp 0.17 +- Dropped .NET Framework 4.6 +- Fixed parser ignoring IsKeepingSourceReferences (#16) + # 0.16.0 Released on Sunday, June 13 2021. diff --git a/LICENSE b/LICENSE index fddded2..aa13fe9 100644 --- a/LICENSE +++ b/LICENSE @@ -1,6 +1,6 @@ The MIT License (MIT) -Copyright (c) 2013 - 2021 AngleSharp +Copyright (c) 2013 - 2022 AngleSharp Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/README.md b/README.md index 4b066c8..26261d5 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -![logo](https://raw.githubusercontent.com/AngleSharp/AngleSharp.Xml/master/header.png) +![logo](https://raw.githubusercontent.com/AngleSharp/AngleSharp.Xml/main/header.png) # AngleSharp.Xml @@ -74,7 +74,7 @@ This project is supported by the [.NET Foundation](https://dotnetfoundation.org) The MIT License (MIT) -Copyright (c) 2020 AngleSharp +Copyright (c) 2020 - 2022 AngleSharp Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: diff --git a/build.cake b/build.cake index 599d7cf..7452f73 100644 --- a/build.cake +++ b/build.cake @@ -3,7 +3,6 @@ var projectName = "AngleSharp.Xml"; var solutionName = "AngleSharp.Xml"; var frameworks = new Dictionary { - { "net46", "net46" }, { "net461", "net461" }, { "net472", "net472" }, { "netstandard2.0", "netstandard2.0" }, diff --git a/src/AngleSharp.Xml.Docs/package.json b/src/AngleSharp.Xml.Docs/package.json index 5c86aab..36bacf8 100644 --- a/src/AngleSharp.Xml.Docs/package.json +++ b/src/AngleSharp.Xml.Docs/package.json @@ -1,6 +1,6 @@ { "name": "@anglesharp/xml", - "version": "0.16.0", + "version": "0.17.0", "preview": true, "description": "The doclet for the AngleSharp.Xml documentation.", "keywords": [ diff --git a/src/AngleSharp.Xml.Tests/AngleSharp.Xml.Tests.csproj b/src/AngleSharp.Xml.Tests/AngleSharp.Xml.Tests.csproj index 1f8eb84..8cec3d2 100644 --- a/src/AngleSharp.Xml.Tests/AngleSharp.Xml.Tests.csproj +++ b/src/AngleSharp.Xml.Tests/AngleSharp.Xml.Tests.csproj @@ -1,6 +1,6 @@  - netcoreapp3.1 + net6.0 true Key.snk false @@ -15,11 +15,11 @@ - - + + - - + + diff --git a/src/AngleSharp.Xml.nuspec b/src/AngleSharp.Xml.nuspec index 8b19167..984b40d 100644 --- a/src/AngleSharp.Xml.nuspec +++ b/src/AngleSharp.Xml.nuspec @@ -10,11 +10,11 @@ logo.png false Adds a powerful XML and DTD parser to AngleSharp. - https://github.com/AngleSharp/AngleSharp.Xml/blob/master/CHANGELOG.md - Copyright 2016-2021, AngleSharp + https://github.com/AngleSharp/AngleSharp.Xml/blob/main/CHANGELOG.md + Copyright 2016-2022, AngleSharp html html5 css css3 dom requester http https xml dtd - + diff --git a/src/AngleSharp.Xml/AngleSharp.Xml.csproj b/src/AngleSharp.Xml/AngleSharp.Xml.csproj index 8931286..3ccbe60 100644 --- a/src/AngleSharp.Xml/AngleSharp.Xml.csproj +++ b/src/AngleSharp.Xml/AngleSharp.Xml.csproj @@ -3,7 +3,7 @@ AngleSharp.Xml AngleSharp.Xml netstandard2.0 - netstandard2.0;net46;net461;net472 + netstandard2.0;net461;net472 true Key.snk true @@ -21,7 +21,7 @@ - + diff --git a/src/AngleSharp.Xml/Parser/Tokens/XmlTagToken.cs b/src/AngleSharp.Xml/Parser/Tokens/XmlTagToken.cs index bd024ec..e98b727 100644 --- a/src/AngleSharp.Xml/Parser/Tokens/XmlTagToken.cs +++ b/src/AngleSharp.Xml/Parser/Tokens/XmlTagToken.cs @@ -1,5 +1,6 @@ namespace AngleSharp.Xml.Parser.Tokens { + using AngleSharp.Dom; using AngleSharp.Text; using System; using System.Collections.Generic; @@ -7,10 +8,10 @@ namespace AngleSharp.Xml.Parser.Tokens /// /// Class for StartTagToken and EndTagToken. /// - sealed class XmlTagToken : XmlToken + sealed class XmlTagToken : XmlToken, ISourceReference { #region Fields - + private readonly List> _attributes; private String _name; private Boolean _selfClosing; diff --git a/src/AngleSharp.Xml/Parser/XmlDomBuilder.cs b/src/AngleSharp.Xml/Parser/XmlDomBuilder.cs index 45f5cbe..728214d 100644 --- a/src/AngleSharp.Xml/Parser/XmlDomBuilder.cs +++ b/src/AngleSharp.Xml/Parser/XmlDomBuilder.cs @@ -63,7 +63,7 @@ public Node CurrentNode { return _openElements[_openElements.Count - 1]; } - + return _document; } } @@ -290,6 +290,11 @@ private void InBody(XmlToken token) _currentMode = XmlTreeMode.After; } + if (_options.IsKeepingSourceReferences) + { + element.SourceReference = tagToken; + } + if (_options.OnCreated != null) { _options.OnCreated.Invoke(element, tagToken.Position); @@ -430,7 +435,7 @@ private Attr CreateAttribute(String name, String value) { ns = CurrentNode.LookupNamespaceUri(prefix); } - + return new Attr(prefix, name.Substring(colon + 1), value, ns); } diff --git a/src/Directory.Build.props b/src/Directory.Build.props index 8a23faf..1068028 100644 --- a/src/Directory.Build.props +++ b/src/Directory.Build.props @@ -2,6 +2,6 @@ Adds a powerful XML and DTD parser to AngleSharp. AngleSharp.Xml - 0.16.0 + 0.17.0 diff --git a/tools/anglesharp.cake b/tools/anglesharp.cake index bfcc3bd..b9d674b 100644 --- a/tools/anglesharp.cake +++ b/tools/anglesharp.cake @@ -1,5 +1,5 @@ -#addin "Cake.FileHelpers" -#addin "Octokit" +#addin nuget:?package=Cake.FileHelpers&version=3.2.0 +#addin nuget:?package=Octokit&version=0.32.0 using Octokit; var configuration = Argument("configuration", "Release"); @@ -28,7 +28,6 @@ if (isRunningOnGitHubActions) if (!isRunningOnWindows) { - frameworks.Remove("net46"); frameworks.Remove("net461"); frameworks.Remove("net472"); }