Skip to content

Commit

Permalink
Require whitespace before tags in description field
Browse files Browse the repository at this point in the history
As of v3.0.3 hamster harvests single word #hash tags from the description
field. This PR tweaks the regex used to extract the tags, requiring
whitespace before the # character. This will prevent harvesting a tag from
a pattern like example.com/page#anchor, as mentioned here:
projecthamster#753 (comment).

This does not affect any of the test cases in test_stuff.py nor the example
from the input.page documentation.
  • Loading branch information
GeraldJansen committed Jan 13, 2024
1 parent 198ebe2 commit 90faaa7
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/hamster/lib/parsing.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
""", flags=re.VERBOSE)

tags_in_description = re.compile(r"""
\s
\#
(?P<tag>
[a-zA-Z] # Starts with an alphabetic character (digits excluded)
Expand Down

0 comments on commit 90faaa7

Please sign in to comment.