Skip to content

[stable8] fix(NcRichText): do not render invalid relative markdown links#8467

Merged
Antreesy merged 2 commits intostable8from
backport/8397/stable8
Apr 24, 2026
Merged

[stable8] fix(NcRichText): do not render invalid relative markdown links#8467
Antreesy merged 2 commits intostable8from
backport/8397/stable8

Conversation

@backportbot
Copy link
Copy Markdown

@backportbot backportbot Bot commented Apr 23, 2026

Warning, This backport's changes differ from the original and might be incomplete ⚠️

Todo

  • Review and resolve any conflicts
  • Review and verify the backported changes
  • Amend HEAD commit to remove the line stating to skip CI

Learn more about backports at https://docs.nextcloud.com/server/stable/go.php?to=developer-backports.

@backportbot backportbot Bot added bug Something isn't working 3. to review Waiting for reviews feature: richtext Related to the richtext component labels Apr 23, 2026
@backportbot backportbot Bot added this to the 8.38.0 milestone Apr 23, 2026
@Antreesy Antreesy force-pushed the backport/8397/stable8 branch from a36081e to 16f1b7a Compare April 23, 2026 13:34
@Antreesy Antreesy changed the base branch from stable8 to backport/8449/stable8 April 23, 2026 13:35
Base automatically changed from backport/8449/stable8 to stable8 April 23, 2026 14:09
@Antreesy Antreesy force-pushed the backport/8397/stable8 branch from 16f1b7a to 887f74c Compare April 23, 2026 14:33
@Antreesy Antreesy marked this pull request as ready for review April 23, 2026 14:34
@Antreesy
Copy link
Copy Markdown
Contributor

Antreesy commented Apr 23, 2026

autolink: true, useMarkdown: false renders as:

text:

    **Testwith** a ~~link~~ *to* [Link](
                https://example:1337
        ) - go visit it <div class="rich-text--wrapper">

html:

      <div>**Testwith** a ~~link~~ *to* [Link](<a href="https://example:1337" rel="noopener noreferrer" target="_blank" class="externalLink externalLink_decorated rich-text--component">
          https://example:1337
        </a>) - go visit it</div>
    </div>

UPD: because <slot name="default">{{ href }}</slot> in new component had a newline 🙈

@Antreesy Antreesy marked this pull request as draft April 23, 2026 15:43
- add noExtDecoration prop for reusing the component

Signed-off-by: Maksim Sukharev <antreesy.web@gmail.com>
- still works: external links, internal absolute links, and internal relative links, that do have a router match for current app
- internal relative links without match (also ?query and #anchor) only render an inner text
- allow tel: and mail: to reduce breaking changes

Signed-off-by: Maksim Sukharev <antreesy.web@gmail.com>
@Antreesy Antreesy force-pushed the backport/8397/stable8 branch from 887f74c to ee3ba36 Compare April 24, 2026 13:14
@Antreesy Antreesy marked this pull request as ready for review April 24, 2026 13:14
@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 24, 2026

Codecov Report

❌ Patch coverage is 92.30769% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 46.84%. Comparing base (ed7419b) to head (ee3ba36).
⚠️ Report is 3 commits behind head on stable8.

Files with missing lines Patch % Lines
...c/components/NcRichText/NcRichTextExternalLink.vue 91.66% 1 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##           stable8    #8467      +/-   ##
===========================================
+ Coverage    46.64%   46.84%   +0.19%     
===========================================
  Files          194      195       +1     
  Lines         4901     4921      +20     
  Branches      1265     1205      -60     
===========================================
+ Hits          2286     2305      +19     
- Misses        2527     2530       +3     
+ Partials        88       86       -2     

☔ View full report in Codecov by Sentry.
📢 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.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@Antreesy Antreesy merged commit 9c6e7e6 into stable8 Apr 24, 2026
21 checks passed
@Antreesy Antreesy deleted the backport/8397/stable8 branch April 24, 2026 13:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

3. to review Waiting for reviews bug Something isn't working feature: richtext Related to the richtext component

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants