Skip to content

fix(content): links written into GLPI open in a new window (0.6.2) - #41

Merged
baraline merged 2 commits into
mainfrom
fix/native-link-shape
Oct 7, 2026
Merged

baraline merged 2 commits into
mainfrom
fix/native-link-shape

Conversation

@baraline

@baraline baraline commented Oct 7, 2026

Copy link
Copy Markdown
Owner

Summary

Every link GlpiContentConverter.to_transport writes now carries target="_blank" rel="noopener noreferrer". Patch release 0.6.2; reading is unchanged.

The twin of easyvista_python_client#9 (0.4.2), so the two converters keep writing the same HTML.

Why

GLPI's own editor writes target="_blank" on a link. Without it, a link opens in place of the page showing it. On the EasyVista side, a live measurement (2026-10-07) showed that only a link carrying target="_blank" opened in a new window; bare links opened in place. Both converters render a pivot with the same cmark-gfm call, and a sync between the two ITSMs relies on them rendering alike, so the change is made in both. noreferrer is written here too for that reason.

What changes

  • markdown_to_html adds the two attributes to each anchor cmark-gfm writes: href, plus an optional title. That covers plain, titled, autolink and image-inside-a-link links. A link shown as code stays text. Write models render through the same function, so a followup, task, solution or ticket body written through them carries the attributes too.
  • Reading ignores target and rel, so from_transport(to_transport(m)) is unchanged for every link (new round-trip tests).
  • Version 0.6.2 in pyproject, __version__ and all eleven skills, the CHANGELOG section, and the user guide's writing paragraph.

Test plan

  • Full suite: 1770 passed, 55 skipped, 1 xfailed
  • pre-commit: ruff check, ruff format, mypy (strict), unasync check
  • Mutation: removing the rewrite fails 6 tests, dropping its title branch fails 1

🤖 Generated with Claude Code

Every link to_transport writes now carries target="_blank" rel="noopener noreferrer".
GLPI's own editor writes target="_blank" on a link, and without it a link opens in place
of the page showing it. Write models render through the same function, so a followup,
task, solution or ticket body written through them carries it too.

The twin of easyvista-python-client 0.4.2 (baraline/easyvista_python_client#9), which
makes the same change after a live measurement on EasyVista's memo view; the two
converters keep writing the same HTML. noreferrer is written here too for that reason.

Reading ignores both attributes, so from_transport(to_transport(m)) is unchanged for every
link: plain, titled, autolink and an image inside a link. A link shown as code stays
text. The rewrite matches only the anchor shape cmark-gfm writes (href, optional title).

Version 0.6.2 in pyproject.toml, __version__ and all eleven skills; the changelog section;
the user guide's writing paragraph.

Measured: full suite 1770 passed, 55 skipped, 1 xfailed; mypy and ruff clean. Removing
the rewrite fails 6 tests, dropping the title branch fails 1.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@codecov-commenter

codecov-commenter commented Oct 7, 2026 •

Copy link
Copy Markdown

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 97.86%. Comparing base (a9e60dd) to head (8c768d2).
❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@           Coverage Diff           @@
##             main      #41   +/-   ##
=======================================
  Coverage   97.86%   97.86%           
=======================================
  Files          90       90           
  Lines        3377     3380    +3     
=======================================
+ Hits         3305     3308    +3     
  Misses         72       72           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

…y 9.2

CI on this branch failed "Lint, typing, and docs" with eight `Unused "type: ignore
[method-assign]"` errors in _async/_testing.py and _sync/_testing.py, lines this branch
does not touch. The cause is tenacity 9.2.1 (CI had 9.1.4 on 2026-10-03, when main was
green, with the same mypy 2.4.0): its retry decorator is typed differently, so mypy no
longer sees the retried _get_request/_post_request/_update_request/_delete_request as
methods, and the method-assign code is unused. main fails the same way today.

The four assignments now list unused-ignore beside their codes, which is mypy's way to
mark an ignore as version-dependent: still needed on tenacity 9.1.x, unused on 9.2.x.
_async edited, _sync regenerated by unasync_build.py.

Measured: mypy clean with tenacity 9.1.4 and with 9.2.1; full suite 1770 passed.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@baraline
baraline merged commit 3d3b707 into main Oct 7, 2026
7 checks passed
@baraline
baraline deleted the fix/native-link-shape branch October 7, 2026 12:40
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.

2 participants