Repository navigation
VFG-85 長い記事の本文を捨てずに、上限の長さで切って使う - #53
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
概要
記事の本文が
articleBody.maxCharsを超えると本文を使わず要約に戻っていたため、深く解説したい長い記事ほど本文が使われませんでした。超えた本文は捨てずに、段落の境目に寄せて先頭から上限までで切って使います。変更内容
fetchArticleBodyが、上限を超えた本文を例外にせず、段落の境目 (なければ行の境目、境目が上限の半分より手前にしかなければ上限ちょうど) で切って返す。コードの塊の途中で切れたときは塊を閉じるoriginalChars) と切ったか (truncated) を持たせるscript.check.jsonのarticleBodyに出す (本文は出さない)動作確認
pnpm lint、pnpm typecheck、pnpm test、pnpm format:checkが通るリスクの確認
.env*、キー、トークン) を含めていない補足