fix: extract correct author name in content script#49
Conversation
Updates the author extraction logic in `source/chrome/contentScript.js` to correctly skip the 'Your Kindle Notes For:' paragraph and extract the actual author's name, mirroring the fix previously applied to `batchExport.js`. Adds a basic Jest test setup and verifies the logic. Co-authored-by: tuliosousapro <40772981+tuliosousapro@users.noreply.github.com>
|
👋 Jules, reporting for duty! I'm here to lend a hand with this pull request. When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down. I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job! For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with New to Jules? Learn more at jules.google/docs. For security, I will only act on instructions from the user who triggered this task. |
There was a problem hiding this comment.
Code Review
This pull request introduces a testing suite using Jest and JSDOM, including a configuration file and a new test for author extraction. The core logic in contentScript.js is updated to improve author detection by targeting specific metadata elements. Review feedback highlights that the specified dependency versions in package.json are likely invalid and suggests a fallback for the author extraction logic to prevent empty strings when metadata is present but blank.
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
Updates the author extraction logic in
source/chrome/contentScript.jsto avoid incorrectly capturing the "Your Kindle Notes For:" prefix paragraph. This brings the logic in line with the fix already implemented inbatchExport.js. A new test case is added undertests/usingjestandjsdomto verify the DOM querying logic works as expected.PR created automatically by Jules for task 6415276485350050814 started by @tuliosousapro