Skip to content

ci: rename - #59

Closed
saturley-hall wants to merge 2 commits into
mainfrom
harrison/rename_to_ai-dyname
Closed

saturley-hall wants to merge 2 commits into
mainfrom
harrison/rename_to_ai-dyname

Conversation

@saturley-hall

Copy link
Copy Markdown
Member

Overview:

Details:

Where should the reviewer start?

Related Issues: (use one of the action keywords Closes / Fixes / Resolves / Relates to)

  • closes GitHub issue: #xxx

@saturley-hall
saturley-hall deleted the harrison/rename_to_ai-dyname branch March 8, 2025 18:16
dagil-nvidia added a commit that referenced this pull request Jul 15, 2026
Bug 1 — comment bodies were displayed as raw text. Request GitHub's
server-rendered HTML via `Accept: application/vnd.github.full+json`
(returns `body_html` alongside `body`) and inject the sanitized HTML in
commentHtml(). Every card — inline review, revision discussion, design
discussion — now shows bold, italic, inline code, fenced code, links,
lists, blockquotes, and headings.

- ghGet() sends the "full" media type header.
- sanitizeHtml() is a pure regex pass that strips <script>, <iframe>,
  <object>, <embed>, <style>, <link>, <meta>, <base>, <svg>, <math>,
  <form>; drops any on*= handler attribute; neutralizes javascript:,
  data:, and vbscript: URIs on href/src/xlink:href.
- hardenLinks() then walks the parsed DOM and sets target="_blank"
  rel="noopener noreferrer" on every anchor in each rendered card
  (mount + per-anchor cards), so external links always open in a new
  tab regardless of how GitHub emitted the anchor.
- commentHtml() falls back to the previous plaintext-in-<p> wrapper
  when body_html is absent (offline fixtures, legacy payloads).
- Anchoring, 💬 badge placement (including the hyperlink-anchor fix),
  and bot filtering (user.type === "Bot" || login endsWith "[bot]")
  are all unchanged.

Bug 2 — cards had a lot of vertical whitespace. Tightened the inline
CSS (which is where the DEP card styles live, injected by the runtime
per the "single source" note in the file header; fern/main.css hosts
the shared NVIDIA theme vars the card colors resolve against):

- .dep-pr-card margin 6/0/12 -> 2/0/8, padding 9/11 -> 8/11/7.
- .dep-pr-card-eyebrow bottom gap 6 -> 3.
- .dep-pr-comment separator margin+padding 9/9 -> 6/6.
- .dep-pr-comment-head bottom gap 3 -> 1.
- .dep-pr-body line-height 1.45 -> 1.4, paragraph gap 4 -> 3.
- .dep-pr-link top gap 4 -> 2.
- New compact rules for the markdown surfaces (headings/ul/ol/li/
  blockquote/code/pre/a/img/.highlight) keep body_html tight without
  bleeding into the surrounding DEP prose.

Tests: fern/js/test_dep_pr_comments.mjs — 13 cases exercising
sanitizeHtml() (strips script/iframe/object/embed/style/link/meta/
base/svg/math/form; drops on*= handlers; neutralizes js:/data:/
vbscript: URIs; preserves code/blockquote/list/http-href/mailto/
relative; handles null/empty; passes real ryanolson comments #7 and
#59 verbatim). Run via `node fern/js/test_dep_pr_comments.mjs`.

Verified locally: node --check passes; sanitizer tests 13/13; fern
check reports 0 errors and 1060 pre-existing warnings (unchanged).

Signed-off-by: Dan Gil <[email protected]>

This branch had an error being deployed

1 failed deployment
GITLAB — f2c06a93 Deployed Mar 8, 2025 by saturley-hall
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.

1 participant