Skip to content
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

Href method added to HyperLink. #21

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

raminmjj
Copy link

This method returns the value of the href.

Copy link
Owner

@rflechner rflechner left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for your contrib.
I will try to make this project more testable to facilitate maintainability

{
var ret = string.Empty;
if (node.HasAttributes)
ret = node.Attributes["href"].Value;
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

risk of Exception when href is not present

case ElementSearchKind.Title:
return from n in html.Descendants(tagName)
let title = n.GetAttributeValue("title", string.Empty)
let fixedTitle = title.Replace(" ", " ").Trim()
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will only treat double spaces cases.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants