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

Fixed bug on JSON metadata when ld+JSON is formatted wrong #296

Merged
merged 5 commits into from Feb 7, 2023
Merged

Fixed bug on JSON metadata when ld+JSON is formatted wrong #296

merged 5 commits into from Feb 7, 2023

Conversation

felipehertzer
Copy link
Contributor

Hi @adbar,

I was testing the JSON metadata and I found this bug, the JSON is wrong, but it was causing an exception in the script. I saw your message about testing, as soon I have time I will contribute.

"author":{"@type":"Person","name":{"@type":"Person","name":"John Smiths"}}

Article:
https://bit.ly/40KbH1w

Before:

AttributeError: 'dict' object has no attribute 'lower'

Now:

"author": "John Smiths"

@codecov-commenter
Copy link

codecov-commenter commented Feb 7, 2023

Codecov Report

Merging #296 (079fbf2) into master (2571ad1) will increase coverage by 0.00%.
The diff coverage is 100.00%.

📣 This organization is not using Codecov’s GitHub App Integration. We recommend you install it so Codecov can continue to function properly for your repositories. Learn more

@@           Coverage Diff           @@
##           master     #296   +/-   ##
=======================================
  Coverage   95.08%   95.09%           
=======================================
  Files          21       21           
  Lines        3256     3259    +3     
=======================================
+ Hits         3096     3099    +3     
  Misses        160      160           
Impacted Files Coverage Δ
trafilatura/json_metadata.py 95.68% <100.00%> (+0.11%) ⬆️

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

@adbar
Copy link
Owner

adbar commented Feb 7, 2023

Nice catch, thanks!

@adbar adbar merged commit 4d4baa7 into adbar:master Feb 7, 2023
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.

None yet

3 participants