Skip to content

Commit

Permalink
Merge pull request #185 from g0v/improve-regex-for-js
Browse files Browse the repository at this point in the history
bug: remove comman inside string in NUXT hydration
  • Loading branch information
ddio authored Oct 29, 2024
2 parents 65c9ecb + 173bc3b commit 5e4f547
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions scrapy-tw-rental-house/scrapy_twrh/spiders/rental591/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,9 @@ def list_values(self):

# dirty hack 1, remove comma from "12,345" XD
value_str = re.sub(r'"(\d+),(\d+)"', r'\1\2', value_str)
# dirty hack 2, we won't need "市中心,拎包入住,含車位" for now.
# we have to remove the comma in the string
value_str = re.sub(r'"(([^\u0000-\u007F]|\\)[^",]*),[^"]+"', r'\1', value_str)
ret = []
for raw_value in value_str.split(','):
# remove leading and trailing double quotes
Expand Down

0 comments on commit 5e4f547

Please sign in to comment.