Skip to content

update#3

Open
fvoci wants to merge 7 commits into
fvoci:masterfrom
MinecraftForgeFrance:master
Open

update#3
fvoci wants to merge 7 commits into
fvoci:masterfrom
MinecraftForgeFrance:master

Conversation

@fvoci

@fvoci fvoci commented Jul 5, 2025

Copy link
Copy Markdown
Owner

Summary by CodeRabbit

  • 새로운 기능

    • 확장 마크다운 UI 요소에 대한 중국어(간체) 번역이 추가되었습니다.
  • 버그 수정

    • 스포일러 콘텐츠가 단락으로 래핑되어 텍스트 레이아웃 및 방향성이 개선되었습니다.
    • 그룹화된 코드 탭의 표시·레이블·식별자가 더 일관되고 접근성 있게 동작합니다.
  • 문서

    • 그룹화된 코드 구문 설명 문구가 보다 명확하게 업데이트되었습니다.
  • 기타

    • 패키지 버전과 호환성 범위가 상향/확장되었습니다.

@coderabbitai

coderabbitai Bot commented Jul 5, 2025

Copy link
Copy Markdown

Lost in the diff? Review this PR in Change Stack to follow the change map from intent to exact ranges.

Review Change Stack

Important

Review skipped

Review was skipped due to path filters

⛔ Files ignored due to path filters (1)
  • package-lock.json is excluded by !**/package-lock.json

CodeRabbit blocks several paths by default. You can override this behavior by explicitly including those paths in the path filters. For example, including **/dist/** will override the default block on the dist directory, by removing the pattern from both the lists.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: 1826fc51-f110-4c69-80ab-1bc4fd116b66

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

Walkthrough

그룹화된 코드 탭 마크업과 언어 처리 방식이 Bootstrap 5 스타일로 변경되고(언어 접두사 language- 제거, 추출 범위 조정), 스포일러 본문이 <p dir="auto">로 감싸졌습니다. 패키지 버전이 2.1.1로 상승했고 Simplified Chinese 현지화 파일이 추가되었습니다.

Changes

Cohort / File(s) Summary
Library 변경
library.js
applyGroupCode의 그룹화된 코드 추출 범위(끝 오프셋) 조정, 언어 클래스에서 선행 language- 접두사 제거하여 탭 레이블/ID/ARIA에 사용; 탭 마크업을 Bootstrap 5 스타일(div.nav.nav-tabs + button.nav-link data-bs-toggle/data-bs-target)로 전환; 탭 패널에 fade 및 첫 패널에 show active 적용. applySpoiler는 스포일러 본문을 <p dir="auto">...</p>로 래핑.
패키지 메타데이터
package.json
패키지 버전 업데이트: 2.0.22.1.1; nbbpm.compatibility 범위 확장(`^3.0.0
현지화 추가
public/languages/zh-CN/extendedmarkdown.json
간체 중국어 로컬라이제이션 파일 신규 추가(확장 마크다운 UI 텍스트 번역 키-값 쌍).
문서 소소한 변경
README.md
Grouped code 설명 텍스트 소폭 문구 변경(표현 수정, 예시/코드 블록 변경 없음).

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Poem

🐇
탭이 바뀌고 언어가 가벼워졌네,
스포일러 속 문단 살포시 안겨요.
버전은 높아지고 새 말이 더해져,
토끼는 깡충, 기쁜 발자국 남기네. 🥕

🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (1 warning, 1 inconclusive)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
Title check ❓ Inconclusive PR 제목이 '업데이트'로 매우 모호하며, 변경사항의 주요 내용을 구체적으로 설명하지 않습니다. PR 제목을 더 구체적으로 변경하세요. 예: 'Bootstrap 5 탭 UI 및 다국어 지원 업데이트' 또는 'Bootstrap 5 마이그레이션 및 중국어 로컬라이제이션 추가'
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@fvoci fvoci self-assigned this Jul 5, 2025
dependabot Bot and others added 3 commits March 6, 2026 15:47
Bumps [underscore](https://github.com/jashkenas/underscore) from 1.13.7 to 1.13.8.
- [Commits](jashkenas/underscore@1.13.7...1.13.8)

---
updated-dependencies:
- dependency-name: underscore
  dependency-version: 1.13.8
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@library.js`:
- Line 144: The current langCodeRegex and extraction
(langCodeRegex.exec(codeArray[i])[1].replace(/^language-/, '')) can yield
multi-class values like "language-python hljs" which produce invalid IDs; update
the extraction logic used with langCodeRegex and lang[i] (and its later use in
id="${lang[i] + count + id}") to isolate only the token that starts with
"language-" (for example change the regex to capture only the language token or
split the captured class string on whitespace and pick the element matching
/^language-/), then strip the "language-" prefix to produce a single-word
language identifier for lang[i].
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: e9519a56-9a0f-4be8-97f6-0ea5dee31f79

📥 Commits

Reviewing files that changed from the base of the PR and between 6e56fce and 0486519.

⛔ Files ignored due to path filters (1)
  • package-lock.json is excluded by !**/package-lock.json
📒 Files selected for processing (3)
  • README.md
  • library.js
  • package.json

Comment thread library.js
let lang = [];
for (let i in codeArray) {
lang[i] = langCodeRegex.exec(codeArray[i])[1]; // extract lang for code
lang[i] = langCodeRegex.exec(codeArray[i])[1].replace(/^language-/, ''); // extract lang for code

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🔴 Critical

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Description: Search for code class patterns in the markdown plugin

# Check how markdown plugin generates code block classes
rg -n 'class=.*language' --type js -C 3

Repository: fvoci/nodebb-plugin-extended-markdown

Length of output: 63


🏁 Script executed:

# Find library.js file
find . -name "library.js" -type f

Repository: fvoci/nodebb-plugin-extended-markdown

Length of output: 93


🏁 Script executed:

# Search for langCodeRegex definition and usage
rg -n "langCodeRegex" -A 5 -B 5

Repository: fvoci/nodebb-plugin-extended-markdown

Length of output: 1749


🏁 Script executed:

# Check the actual code blocks around line 144
fd "library.js" --exec head -n 160 {} \; | tail -n 30

Repository: fvoci/nodebb-plugin-extended-markdown

Length of output: 1676


🏁 Script executed:

# Search for markdown plugin references and code block generation
rg -n "language-" -A 2 -B 2 --type js

Repository: fvoci/nodebb-plugin-extended-markdown

Length of output: 468


🏁 Script executed:

# Check if there's a markdown plugin or configuration
find . -name "*markdown*" -type f -o -name "*highlight*" -type f | head -20

Repository: fvoci/nodebb-plugin-extended-markdown

Length of output: 299


🏁 Script executed:

# Search for how <code> tags are generated
rg -n "<code class" -A 1 -B 1 --type js

Repository: fvoci/nodebb-plugin-extended-markdown

Length of output: 321


🏁 Script executed:

# Check the package.json to see what markdown/highlight dependencies are used
cat package.json | grep -A 10 -B 10 "mark\|highlight"

Repository: fvoci/nodebb-plugin-extended-markdown

Length of output: 1267


🏁 Script executed:

# Search for any test files or examples showing code block formats
find . -name "*.test.js" -o -name "*.spec.js" -o -name "*test*" -type f | head -10

Repository: fvoci/nodebb-plugin-extended-markdown

Length of output: 63


🏁 Script executed:

# Check if there's any configuration or documentation about code block format
rg -n "hljs\|highlight\|language-" --type json --type md

Repository: fvoci/nodebb-plugin-extended-markdown

Length of output: 63


🏁 Script executed:

# Check if nodebb-plugin-markdown generates code blocks with multiple classes
# Look at the structure of codeArray elements to understand the format
rg -n "codeArray\|codeTab" -A 3 -B 3 library.js | head -40

Repository: fvoci/nodebb-plugin-extended-markdown

Length of output: 63


🏁 Script executed:

# Search NodeBB markdown plugin documentation or look for test patterns
# Check if there's any example showing what classes are added
rg -n "hljs\|highlight\.js\|highlight" --type js

Repository: fvoci/nodebb-plugin-extended-markdown

Length of output: 63


🏁 Script executed:

# Look for any indication of how <code> elements are formatted
cat library.js | grep -n "class=" | head -20

Repository: fvoci/nodebb-plugin-extended-markdown

Length of output: 1991


🏁 Script executed:

# Check git log to see if there are any commits mentioning code class format
git log --oneline --all | head -20

Repository: fvoci/nodebb-plugin-extended-markdown

Length of output: 944


🏁 Script executed:

# Look at the README for any documentation about the code block format
cat README.md | head -100

Repository: fvoci/nodebb-plugin-extended-markdown

Length of output: 3104


🏁 Script executed:

# Search for any mention of how the markdown plugin processes code
rg -n "nodebb-plugin-markdown\|markdown" README.md

Repository: fvoci/nodebb-plugin-extended-markdown

Length of output: 63


🏁 Script executed:

# Check if there's any commit message or documentation about code class format
git log --all --grep="language\|class\|code" --oneline | head -10

Repository: fvoci/nodebb-plugin-extended-markdown

Length of output: 405


🏁 Script executed:

# Look at the actual structure of what's being processed
# Check if there are any tests or examples in the repo
find . -type f \( -name "*.md" -o -name "*.txt" \) -exec grep -l "language-\|hljs" {} \;

Repository: fvoci/nodebb-plugin-extended-markdown

Length of output: 63


🏁 Script executed:

# Check the exact behavior by examining what nodebb-plugin-markdown likely produces
# Look for any comments in library.js about the expected format
sed -n '135,155p' library.js

Repository: fvoci/nodebb-plugin-extended-markdown

Length of output: 1558


🏁 Script executed:

# Check what highlight.js typically generates
# Look for any documentation or examples about the class format
rg -n "hljs\|highlight" . --type md --type json

Repository: fvoci/nodebb-plugin-extended-markdown

Length of output: 63


🏁 Script executed:

# Verify if the issue would occur by checking what classes markdown produces
# Look for the actual output format in any test or example
find . -type f -name "*.json" -o -name "*.txt" | xargs grep -l "language-" 2>/dev/null | head -5

Repository: fvoci/nodebb-plugin-extended-markdown

Length of output: 63


🏁 Script executed:

# Check if there's any real-world example in commit history showing the HTML output
git log -p --all | grep -A 3 '<code class=' | head -20

Repository: fvoci/nodebb-plugin-extended-markdown

Length of output: 63


🏁 Script executed:

# Check the nodebb-plugin-markdown documentation or its typical behavior
# Since it's a peer dependency, let's see if there are any related issues or docs
rg -n "peer" package.json -A 5

Repository: fvoci/nodebb-plugin-extended-markdown

Length of output: 181


🏁 Script executed:

# Create a simple test to understand the regex behavior
node <<'EOF'
const langCodeRegex = /<code class="(.+)">/;

// Test cases based on typical markdown/highlight.js output
const testCases = [
  '<code class="language-python">',
  '<code class="language-python hljs">',
  '<code class="python">',
  '<code class="language-javascript highlight">',
];

console.log("Testing langCodeRegex behavior:");
testCases.forEach(test => {
  const match = langCodeRegex.exec(test);
  if (match) {
    const extracted = match[1];
    const afterReplace = extracted.replace(/^language-/, '');
    const isValidId = !afterReplace.includes(' ');
    console.log(`\nInput: ${test}`);
    console.log(`Captured: "${extracted}"`);
    console.log(`After replace: "${afterReplace}"`);
    console.log(`Valid HTML ID: ${isValidId}`);
  }
});

// Test the proposed fix
const proposedRegex = /<code class="(?:language-)?([^\s"]+)/;
console.log("\n\nTesting proposed regex:");
testCases.forEach(test => {
  const match = proposedRegex.exec(test);
  if (match) {
    const extracted = match[1];
    console.log(`\nInput: ${test}`);
    console.log(`Captured: "${extracted}"`);
    console.log(`Valid HTML ID: ${!extracted.includes(' ')}`);
  }
});
EOF

Repository: fvoci/nodebb-plugin-extended-markdown

Length of output: 949


langCodeRegex가 여러 클래스를 포함할 경우 유효하지 않은 HTML ID를 생성합니다.

/<code class="(.+)">/ 정규식이 class 속성의 전체 값을 캡처합니다. 마크다운 플러그인이 "language-python hljs" 같은 다중 클래스를 생성하면, .replace(/^language-/, '')를 적용한 후 python hljs 같은 공백을 포함한 문자열이 탭 ID로 사용되어 유효하지 않은 HTML ID가 됩니다 (라인 150-151에서 id="${lang[i] + count + id}"로 사용됨).

🛠️ 언어만 추출하도록 정규식 수정 제안
-const langCodeRegex = /<code class="(.+)">/;
+const langCodeRegex = /<code class="(?:language-)?([^\s"]+)/;
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@library.js` at line 144, The current langCodeRegex and extraction
(langCodeRegex.exec(codeArray[i])[1].replace(/^language-/, '')) can yield
multi-class values like "language-python hljs" which produce invalid IDs; update
the extraction logic used with langCodeRegex and lang[i] (and its later use in
id="${lang[i] + count + id}") to isolate only the token that starts with
"language-" (for example change the regex to capture only the language token or
split the captured class string on whitespace and pick the element matching
/^language-/), then strip the "language-" prefix to produce a single-word
language identifier for lang[i].

The tooltipRegex used .* for both the display-text and tooltip-text
captures, which greedily ran to the last ° / ) on the line. When a user
followed a bubble with another parenthesized phrase on the same line,
e.g.

    °°(tooltip text) (something else)

the tooltip captured "tooltip text) (something else" instead of just
"tooltip text". A real example surfaced on diy-il.forum where a user
wrote a bubble immediately followed by an explanatory parenthetical and
the rendered title contained both phrases joined by stray parens.

Replace the two .* captures with bounded character classes:

  - display text: [^°]* — cannot cross the bubble's own closing °
    (also fixes two adjacent bubbles on one line eating each other)
  - tooltip text: [^)]* — stops at the first ), the literal terminator

Newlines previously masked the bug (. doesn't cross \n in JS by default),
which is why pressing Enter after the bubble appeared to "fix" it.

Co-authored-by: shraga100 <shraga100@users.noreply.github.com>

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

♻️ Duplicate comments (1)
library.js (1)

144-151: ⚠️ Potential issue | 🟠 Major | ⚡ Quick win

그룹 코드 언어 추출이 클래스 전체를 가져와 탭 연결을 깨뜨립니다.

Line 144에서 class 전체 문자열을 언어로 사용해 공백이 포함될 수 있고, 이 값이 Line 150-151의 id/data-bs-target로 흘러가 탭 패널 매칭이 실패할 수 있습니다. 언어 토큰만 분리해서 사용해야 합니다.

수정 예시
-const langCodeRegex = /<code class="(.+)">/;
+const langCodeRegex = /<code class="([^"]+)">/;

 ...
-                lang[i] = langCodeRegex.exec(codeArray[i])[1].replace(/^language-/, ''); // extract lang for code
+                const classAttr = langCodeRegex.exec(codeArray[i])?.[1] || '';
+                const langToken = classAttr.split(/\s+/).find(token => token.startsWith('language-')) || classAttr.split(/\s+/)[0] || 'text';
+                lang[i] = langToken.replace(/^language-/, ''); // extract lang for code
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@library.js` around lines 144 - 151, The code is using the entire class
attribute string as the language (lang[i] = langCodeRegex.exec(codeArray[i])[1])
which can include spaces and break HTML id/data-bs-target matching; update the
extraction in the block that builds lang[] so it normalizes to a single language
token (e.g., run the regex result through .trim(), split on whitespace and take
the first token or further match only the language token like
/^language-([^\s]+)/) before using it in menuTab/contentTab IDs; ensure the rest
of code (lang[], menuTab, contentTab, capitalizeFirstLetter, count, id) uses
that cleaned single token so generated ids/data-bs-target values are valid and
unique.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Duplicate comments:
In `@library.js`:
- Around line 144-151: The code is using the entire class attribute string as
the language (lang[i] = langCodeRegex.exec(codeArray[i])[1]) which can include
spaces and break HTML id/data-bs-target matching; update the extraction in the
block that builds lang[] so it normalizes to a single language token (e.g., run
the regex result through .trim(), split on whitespace and take the first token
or further match only the language token like /^language-([^\s]+)/) before using
it in menuTab/contentTab IDs; ensure the rest of code (lang[], menuTab,
contentTab, capitalizeFirstLetter, count, id) uses that cleaned single token so
generated ids/data-bs-target values are valid and unique.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: f0cc94c0-73ad-4d7a-b910-732ad51e6f94

📥 Commits

Reviewing files that changed from the base of the PR and between 0486519 and 8bdb484.

📒 Files selected for processing (1)
  • library.js

Bumps [markdown-it](https://github.com/markdown-it/markdown-it) and [nodebb-plugin-markdown](https://github.com/julianlam/nodebb-plugin-markdown). These dependencies needed to be updated together.

Updates `markdown-it` from 12.3.2 to 14.2.0
- [Changelog](https://github.com/markdown-it/markdown-it/blob/master/CHANGELOG.md)
- [Commits](markdown-it/markdown-it@12.3.2...14.2.0)

Updates `nodebb-plugin-markdown` from 13.1.0 to 13.2.5
- [Commits](NodeBB/nodebb-plugin-markdown@v13.1.0...v13.2.5)

---
updated-dependencies:
- dependency-name: markdown-it
  dependency-version: 14.2.0
  dependency-type: indirect
- dependency-name: nodebb-plugin-markdown
  dependency-version: 13.2.5
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
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.

4 participants