Skip to content

Parser ignoring IsKeepingSourceReferences #16

New issue

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

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

Already on GitHub? Sign in to your account

Closed
5 tasks done
dompagoj opened this issue Mar 1, 2022 · 2 comments
Closed
5 tasks done

Parser ignoring IsKeepingSourceReferences #16

dompagoj opened this issue Mar 1, 2022 · 2 comments
Labels
bug Something isn't working good first issue Good for newcomers help wanted Extra attention is needed

Comments

@dompagoj
Copy link

dompagoj commented Mar 1, 2022

Bug Report

Prerequisites

  • Can you reproduce the problem in a MWE?
  • Are you running the latest version of AngleSharp?
  • Did you check the FAQs to see if that helps you?
  • Are you reporting to the correct repository? (there are multiple AngleSharp libraries, e.g., AngleSharp.Css for CSS support)
  • Did you perform a search in the issues?

Description

Running the parser with XmlParserOptions() { IsKeepingSourceReferences = true, } doesn't actually keep the source references, i looked into the source code and while the HtmlParser checks IsKeepingSourceReferences and assignes the source reference correctly as can be seen here
image

The xml parser never does that, meaning IElement.SourceReference is always null

Steps to Reproduce

  1. Create a XmlParser with XmlParserOptions() { IsKeepingSourceReferences = true, }
  2. Run Parse

**Expected behavior: IElements should have SourceReference set

**Actual behavior: SourceReference is always null

**Environment details: Linux, .NET 6

Possible Solution

Look into how the HtmlDomBuilder handles it and possibly just copy it, (don't know much about the repo so probably just ignore what i said)

@dompagoj dompagoj added the bug Something isn't working label Mar 1, 2022
@FlorianRappl
Copy link
Contributor

Yeah good point - should be implemented.

@FlorianRappl FlorianRappl added good first issue Good for newcomers help wanted Extra attention is needed labels Mar 2, 2022
@FlorianRappl
Copy link
Contributor

Landed in devel.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working good first issue Good for newcomers help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants