Skip to content

fix(content): links written into a memo open in a new window (0.4.2) - #9

Merged
baraline merged 1 commit into
mainfrom
fix/native-link-shape
Oct 7, 2026
Merged

baraline merged 1 commit into
mainfrom
fix/native-link-shape

Conversation

@baraline

@baraline baraline commented Oct 7, 2026

Copy link
Copy Markdown
Owner

Summary

Every link EasyvistaContentConverter.to_transport writes now carries target="_blank" rel="noopener noreferrer", the shape EasyVista's own editor writes on a link. Patch release 0.4.2; reading is unchanged.

Why

EasyVista's memo view opens a link without target="_blank" in place, inside EasyVista's own window, so a link to another application appeared to do nothing. Measured on a live memo (2026-10-07), with three links side by side:

Link as stored What a click did
<a href="…"> opened in place
<a href="…" target="_blank" rel="noopener noreferrer"> opened a new window
<p>… <a href="…"></p> opened in place

The memo kept the attributes exactly as sent. A link typed in EasyVista's editor is stored with target="_blank" rel="noopener noreferrer". A pasted one (data-fr-linked, Froala) is stored without them, and it opens in place too.

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.
  • Reading ignores target and rel, so from_transport(to_transport(m)) is unchanged for every link (new round-trip tests).
  • Version 0.4.2 everywhere the release convention puts it: pyproject, __version__, the public-API test, all nine skills, CHANGELOG and its compare link, and docs/content.rst's writing section.

Twin

glpi_python_client renders with the same cmark-gfm call, and its reader is this package's twin. A matching change is being prepared there (0.6.2) so the two keep writing the same HTML. GLPI's own editor also stores links with target="_blank".

Test plan

  • Full suite: 2145 passed, 96 skipped (live/integration)
  • mypy easyvista_python_client and ruff check . clean
  • Mutation: removing the rewrite fails 6 tests, dropping its title branch fails 1
  • ruff format --check reports 14 files that already differ on main, none touched here

🤖 Generated with Claude Code

Every link to_transport writes now carries target="_blank" rel="noopener noreferrer",
the shape EasyVista's own editor writes on a link. Without it the memo view opens the
link in place, inside EasyVista's window, so a link to another application seemed to do
nothing. Measured on a live memo (2026-10-07): three links side by side, bare, with the
attributes, and bare inside a paragraph; only the one with target="_blank" opened a new
window, and the stored HTML kept the attributes as sent.

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.4.2 in pyproject.toml, __version__, the public-API test and all nine skills;
the changelog section and its compare link; docs/content.rst's writing section.

Measured: full suite 2145 passed, 96 skipped; mypy and ruff check clean. Removing the
rewrite fails 6 tests, dropping the title branch fails 1. (`ruff format --check` lists
14 files on main already, none touched here.)

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

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 98.93%. Comparing base (59049b6) to head (346fe11).
❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@           Coverage Diff           @@
##             main       #9   +/-   ##
=======================================
  Coverage   98.92%   98.93%           
=======================================
  Files          40       40           
  Lines        2614     2617    +3     
=======================================
+ Hits         2586     2589    +3     
  Misses         28       28           

☔ 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.

@baraline

baraline commented Oct 7, 2026

Copy link
Copy Markdown
Owner Author

Twin opened: baraline/glpi_python_client#41 (0.6.2) makes the same change, so both converters keep writing the same HTML.

@baraline
baraline merged commit 071e867 into main Oct 7, 2026
6 checks passed
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