-
Notifications
You must be signed in to change notification settings - Fork 2
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
改行問題に対応するためJSDOMから変更 #147
改行問題に対応するためJSDOMから変更 #147
Conversation
This PR is linked to issue #144 |
### ウォークスルー
この変更では、HTMLコンテンツの解析に使用するパーサーを`jsdom`から`htmlparser2`に変更し、特定の属性を持つ要素のテキスト内容を収集する機能が強化されました。また、システムメッセージ生成関数の出力フォーマットに関する指示が追加され、改行文字を保持するようになりました。
### 変更点
| ファイル | 要約 |
| --- | --- |
| web/app/feature/translate/utils/extractNumberedElements.ts | `extractNumberedElements`関数が`jsdom`から`htmlparser2`に変更され、`data-number`属性を持つ要素を検出し、そのテキスト内容を収集するようになりました。 |
| web/app/feature/translate/utils/generateGeminiMessage.ts | `generateSystemMessage`関数の出力フォーマットに関する指示が追加され、改行文字を保持するようになりました。 | Uplevel your code reviews with CodeRabbit ProCodeRabbit ProIf you like this project, please support us by purchasing the Pro version. The Pro version has advanced context, superior noise reduction and several proprietary improvements compared to the open source version. Moreover, CodeRabbit Pro is free for open source projects. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Files selected (2)
- web/app/feature/translate/utils/extractNumberedElements.ts (1)
- web/app/feature/translate/utils/generateGeminiMessage.ts (2)
Review comments generated (12)
- Review: 1
- LGTM: 11
Tips
Chat with
CodeRabbit Bot (@coderabbitai
)
- Reply on review comments left by this bot to ask follow-up questions. A review comment is a comment on a diff or a file.
- Invite the bot into a review comment chain by tagging
@coderabbitai
in a reply.
Code suggestions
- The bot may make code suggestions, but please review them carefully before committing since the line number ranges may be misaligned.
- You can edit the comment made by the bot and manually tweak the suggestion if it is slightly off.
Pausing incremental reviews
- Add
@coderabbitai: ignore
anywhere in the PR description to pause further reviews from the bot.
ontext(text) { | ||
if (inNumberedElement) { | ||
currentText.push(text.trim()); | ||
} | ||
}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Closes #144
Summary by CodeRabbit