Skip to content

Commit e787008

Browse files
committed
添加日志,解析页面来源
1 parent ed4958f commit e787008

2 files changed

Lines changed: 16 additions & 1 deletion

File tree

src/pages/guestbook/index.astro

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -691,7 +691,7 @@ function getReactionEmoji(reaction: string) {
691691
data-repo-id="R_kgDOLTuIuQ"
692692
data-category="General"
693693
data-category-id="DIC_kwDOLTuIuc4Csz7O"
694-
data-mapping="og:title"
694+
data-mapping="pathname"
695695
data-strict="0"
696696
data-reactions-enabled="1"
697697
data-input-position="top"

src/scripts/fetch-comments.js

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -265,6 +265,21 @@ async function main() {
265265
`Successfully wrote ${structuredComments.length} structured discussions to src/data/comments-structured.json`
266266
)
267267

268+
// --- DEBUG: Log bodyHTML for comments with code blocks ---
269+
const commentsWithCode = allComments.filter(comment => comment.bodyHTML.includes('<pre><code'));
270+
if (commentsWithCode.length > 0) {
271+
console.log('\n--- bodyHTML for comments with code blocks ---');
272+
commentsWithCode.forEach((comment, index) => {
273+
console.log(`\nComment ID: ${comment.id}`);
274+
console.log(`Author: ${comment.author.login}`);
275+
console.log(`bodyHTML:\n${comment.bodyHTML}`);
276+
});
277+
console.log('--------------------------------------------\n');
278+
} else {
279+
console.log('\nNo comments with code blocks found in fetched data.\n');
280+
}
281+
// --- END DEBUG ---
282+
268283
// 输出统计信息
269284
const stats = {
270285
totalDiscussions: discussions.length,

0 commit comments

Comments
 (0)