fix: cleanComments filter not applied to api.title and api.description in api-endpoint.njk
維護者通常 2 天內回覆
還沒有人認領這個 Issue。
評估
- 難度
- 1/5
- 預估耗時
- 1 小時以內
- 新手友好度
- 86/100
- Issue 類型
- 缺陷
- 描述清晰度
- 描述清楚
- 活躍度
- 活躍
- 技術堆疊
- node.js, typescript
研究方向
閱讀 src/generator/templates/api-endpoint.njk,並將運算式 api.title 和 api.description 與其他使用 cleanComments 的描述欄位進行比較。Issue 指出了缺少的兩處篩選器套用,以及預期的運算式。兩個欄位都經過一致的清理後,工作即告完成;檢查涵蓋此範本的產生器測試。
由索引模型根據 Issue 內容生成。
描述
Summary
The cleanComments filter in filters.ts (lines 85–93) neutralises */ and /*
to prevent them from escaping JSDoc block comments in generated TypeScript. It is
applied to every method, parameter, and schema description field in
api-endpoint.njk, but is missing from api.title and api.description
at lines 58 and 60.
Expected behaviour
api.title and api.description are sanitised with cleanComments, consistent
with every other description field in the same template.
Actual behaviour
Both fields are rendered raw. The filter already exists and already handles this
case, it is simply not applied to these two fields.
Proposed fix
Two-line change in src/generator/templates/api-endpoint.njk:
Line 58
Before: * {{ api.title }}
After: * {{ api.title | cleanComments | safe }}
Line 60
Before: * {{ api.description | replace("\n", "\n * ") }}
After: * {{ api.description | cleanComments | safe | replace("\n", "\n * ") }}
I'm happy to submit a PR if the fix looks good.
- 主要語言
- TypeScript
- 星號
- 12.3k
- 分支
- 2k
- 平均合併
- 3 天 10 小時
- 30 天內合併 PR
- 9
環境準備
- 沒有 Dockerfile 或 Docker Compose 檔案
- 有 Pull Request 範本
- 閱讀貢獻指南
從這裡開始
- 先讀完整個 Issue,再讀專案的貢獻指南。
- 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
- Fork 儲存庫,在一個分支上完成修改。
- 送出 Pull Request,並在描述裡引用這個 Issue 編號。
googleapis/google-api-nodejs-client 的其他 Issue
-
難度 4/5 1-2 天 新手友好度 5/100
googleapis/google-api-nodejs-client#4067 ·
維護者通常 2 天內回覆
-
難度 5/5 一週以上 新手友好度 1/100
googleapis/google-api-nodejs-client#4063 ·
維護者通常 2 天內回覆
-
eMudhra/emSign CA compromise (October 2026): what Cloud SDK Node.js Libraries developers need to do未關閉
難度 1/5 1 小時以內 新手友好度 10/100
googleapis/google-api-nodejs-client#4062 ·
維護者通常 2 天內回覆
-
難度 5/5 一週以上 新手友好度 10/100
googleapis/google-api-nodejs-client#4061 ·
維護者通常 2 天內回覆
-
難度 5/5 一週以上 新手友好度 32/100
googleapis/google-api-nodejs-client#3932 · 1 則留言 ·
維護者通常 2 天內回覆
查看 googleapis/google-api-nodejs-client 的全部 Issue
相似的 Issue
-
parse: child keys like `007`, `1e3`, `0x1f`, `-1` make the parent an empty array and hide the value未關閉
難度 2/5 1-3 小時 新手友好度 78/100
-
enhancement follow-up
難度 2/5 1-3 小時 新手友好度 78/100
維護者通常 1 天內回覆
-
難度 1/5 1 小時以內 新手友好度 62/100
bketelsen/pi-pocket-team#232 ·
維護者通常 1 天內回覆
-
bug UI
難度 2/5 1-3 小時 新手友好度 70/100
wardian-app/Wardian#1746 ·
維護者通常 1 天內回覆
-
area: interop area: sip-core v3
難度 2/5 1-3 小時 新手友好度 62/100
維護者通常 1 天內回覆