Skip to content

Commit 6e2943f

Browse files
committed
Updated the readme and added a new example.
1 parent cdb4c61 commit 6e2943f

File tree

2 files changed

+13
-1
lines changed

2 files changed

+13
-1
lines changed

README.md

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ You can ignore any links nested inside of another link. Eg with following HTML:
5151
</a>
5252
```
5353

54-
It is okay if your code returns only the outside link, but it should still get all of the text inside the link, including the text inside the nested link.
54+
It is okay if your code returns only the outside link.
5555

5656
**3. Get something working before focusing on edge-cases**
5757

@@ -61,6 +61,13 @@ Don't worry about having perfect code. Chances are there will be a lot of edge c
6161

6262
I created a few simpler HTML files and included them in this repo to help with testing. They won't cover all potential use cases, but should help you start testing out your code.
6363

64+
65+
**5. The fourth example will help you remove comments from your link text**
66+
67+
Chances are your first version will include the text from comments inside a link tag. Mine did. Use [ex4.html](ex4.html) to test that case out and fix the bug.
68+
69+
*Hint: See [NodeType](https://godoc.org/golang.org/x/net/html#NodeType) constants and look for the types that you can ignore.*
70+
6471
## Bonus
6572

6673
The only bonuses here are to improve your tests and edge-case coverage.

ex4.html

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
<html>
2+
<body>
3+
<a href="/dog-cat">dog cat <!-- commented text SHOULD NOT be included! --></a>
4+
</body>
5+
</html>

0 commit comments

Comments
 (0)