feat(cv-v2): hyperlink-aware ProjectRenderer + ProjectLabel (M3, @since 1.6.8)#120
Merged
Merged
Conversation
… 1.6.8)
Closes the v1.6.8 markdown-link feature end-to-end. With M1 the
parser knew about [label](url); after this PR, the CV/cover-letter
ProjectRenderer actually emits a clickable link when a project
row's label is authored as Markdown.
ProjectLabel refactor:
- Old parse() did MarkdownInline.plainText() first, then split on
the last '('. That stripped emphasis AND links up-front, so the
link URL was lost before the renderer ever saw it.
- New parse() targets a trailing `\s+\([^()]*\)\s*$` pattern only.
Result: the title field preserves the original Markdown syntax
([name](url) or **bold** etc.) and is rendered later through
MarkdownInline.append. The stack-paren pattern requires
whitespace before its opening paren, so a leading [name](url)
URL's own (...) segment is not mistaken for the stack delimiter.
- Examples (with the new shape):
* "GraphCompose (Java, PDFBox)" -> title="GraphCompose",
stack="Java, PDFBox"
* "[GraphCompose](url) (Java)" -> title="[GraphCompose](url)",
stack="Java"
* "[GraphCompose](url)" -> title="[GraphCompose](url)",
stack=""
* "**GraphCompose**" -> title="**GraphCompose**",
stack=""
ProjectRenderer wiring:
- ProjectRenderer.inline and .titleThenBody now call
MarkdownInline.append(rich, label.title(), titleStyle) instead
of rich.style(label.title(), titleStyle). Plain-text titles
render identically to before (the emphasis pipeline emits one
styled run); Markdown titles emit emphasis / link runs.
- ProjectRenderer.plainInline (one-line listing variant)
intentionally continues to drop link syntax via plainText() — a
clickable hyperlink would not survive the compact formatting
context (this is the variant used by sidebar / minimal presets).
Compatibility:
- ProjectLabel.parse return shape is unchanged (still a two-field
record). The semantic of `title()` changes: it now keeps inline
Markdown rather than returning a pre-flattened plain-text
projection. That fixed the one in-repo test that pinned the old
abstraction-leak: CvV2ComponentUtilityTest.projectLabelSplitsTrailingStack
was relying on parse() stripping `**` markers up-front; the test
is updated to assert the new shape with an inline comment
pointing at ProjectLabelTest for the full coverage.
- Visual baselines: existing CV v2 visual-parity baselines render
unchanged because the canonical CvDocument fixture does not use
inline Markdown in project labels. The new path is exercised by
the test additions below.
Test plan:
- New ProjectLabelTest (8 tests) — pins legacy "Project (Stack)"
parse, link-only label, link + stack, URL-paren-vs-stack-paren
disambiguation, null/whitespace handling.
- MarkdownInlineTest (from M1) covers the link-run emission path
itself.
- CvV2ComponentUtilityTest.projectLabelSplitsTrailingStack updated
to assert the new shape (`**GraphCompose**` preserved in title).
- ./mvnw verify -pl . -P japicmp - 1057 tests, 0 failures.
japicmp vs v1.6.7 baseline: semver PATCH (compatible internal
rewiring on public methods; no signature change, return-shape
is identical).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Closes the v1.6.8 markdown-link feature end-to-end. With M1
(#119) the
parser knew about
[label](url); after this PR the CV /cover-letter
ProjectRendereractually emits a clickablehyperlink when a project row's label is authored as Markdown.
ProjectLabel refactor
parse()ranMarkdownInline.plainText()first, thensplit on the last
(. That stripped emphasis AND linksup-front, so the link URL was lost before the renderer ever
saw it.
parse()targets a trailing\s+\([^()]*\)\s*$patternonly. Result: the title field preserves the original
Markdown syntax (
[name](url)or**bold**etc.) and isrendered later through
MarkdownInline.append. The stack-parenpattern requires whitespace before its opening paren, so a
leading
[name](url)URL's own(...)segment is not mistakenfor the stack delimiter.
"GraphCompose (Java, PDFBox)""GraphCompose""Java, PDFBox""[GraphCompose](url) (Java)""[GraphCompose](url)""Java""[GraphCompose](url)""[GraphCompose](url)""""**GraphCompose**""**GraphCompose**"""ProjectRenderer wiring
ProjectRenderer.inline(...)and.titleThenBody(...)nowcall
MarkdownInline.append(rich, label.title(), titleStyle)instead of
rich.style(label.title(), titleStyle). Plain-texttitles render identically to before (the emphasis pipeline
emits one styled run); Markdown titles emit emphasis / link
runs.
ProjectRenderer.plainInline(...)(one-line listing variant)intentionally continues to drop link syntax via
MarkdownInline.plainText(...)because a clickable hyperlinkwould not survive the compact formatting context. This is the
variant used by sidebar / minimal presets.
Compatibility
ProjectLabel.parsereturn shape is unchanged (still atwo-field record). The semantic of
title()changes: it nowkeeps inline Markdown rather than returning a pre-flattened
plain-text projection. That fixed the one in-repo test that
pinned the old abstraction-leak:
CvV2ComponentUtilityTest.projectLabelSplitsTrailingStackwasrelying on
parse()stripping**markers up-front; the testis updated to assert the new shape with an inline comment
pointing at
ProjectLabelTestfor the full coverage.unchanged because the canonical
CvDocumentfixture does notuse inline Markdown in project labels. The new path is
exercised by the test additions below.
Test plan
ProjectLabelTest(8 tests) — pins legacy "Project(Stack)" parse, link-only label, link + stack, URL-paren-
vs-stack-paren disambiguation, null/whitespace handling.
MarkdownInlineTestfrom M1 covers the link-run emissionpath itself.
CvV2ComponentUtilityTest.projectLabelSplitsTrailingStackupdated to assert the new shape (
**GraphCompose**preserved in title).
./mvnw verify -pl . -P japicmp— 1057 tests, 0 failures.japicmp vs v1.6.7 baseline:
semver PATCH(compatibleinternal rewiring on public methods; no signature change,
return-shape is identical).