Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Warnings that occurs when bookmark link contains non-ASCII chars #9660

Merged
merged 2 commits into from
Feb 10, 2024

Conversation

filzrev
Copy link
Contributor

@filzrev filzrev commented Jan 29, 2024

This PR intended to fix issue #5233
By adding URI normalization logics when validate bookmark URLs .


Examples markdown that contains non-ASCI chars

# foo

Visit [Québec](#québec).

## Québec

The province or the city.

Generated output HTML

<h2 id="foo">foo</h2>
<p>Visit <a href="#qu%C3%A9bec">Québec</a>.</p>
<h2 id="québec">Québec</h2>
<p>The province or the city.</p>

Background
Markdown link [Québec](#québec) is converted to url-encoded anchor link (#qu%C3%A9bec)
This behavior is according to the CommonMark spec.

Instead, ## Québec heading is converted to <h2 id="québec">
Because it's generated by AutoIdentifier markdig extension.
And docfx explicitly specify AutoIdentifierOptions.GitHub options.

So bookmark URI validation should be executed by Normalized URI comparison.
(In this PR. This normalization is executed by Uri.UnescapeDataString API).

It might be better to use API that comply with the following standard specifications

Copy link

codecov bot commented Jan 29, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (fe673ec) 74.31% compared to head (45e4fc8) 74.31%.
Report is 13 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #9660   +/-   ##
=======================================
  Coverage   74.31%   74.31%           
=======================================
  Files         536      536           
  Lines       23189    23189           
  Branches     4056     4056           
=======================================
  Hits        17234    17234           
  Misses       4853     4853           
  Partials     1102     1102           

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

@yufeih yufeih added the bug-fix Makes the pull request to appear in "Bug Fixes" section of the next release note label Feb 10, 2024
Copy link
Contributor

@yufeih yufeih left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good. Thank you @filzrev !

@yufeih yufeih merged commit 066818a into dotnet:main Feb 10, 2024
8 checks passed
renovate bot referenced this pull request in buehler/dotnet-operator-sdk Feb 18, 2024
[![Mend
Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com)

This PR contains the following updates:

| Package | Change | Age | Adoption | Passing | Confidence |
|---|---|---|---|---|---|
| [docfx](https://togithub.com/dotnet/docfx) | `2.75.2` -> `2.75.3` |
[![age](https://developer.mend.io/api/mc/badges/age/nuget/docfx/2.75.3?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![adoption](https://developer.mend.io/api/mc/badges/adoption/nuget/docfx/2.75.3?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![passing](https://developer.mend.io/api/mc/badges/compatibility/nuget/docfx/2.75.2/2.75.3?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![confidence](https://developer.mend.io/api/mc/badges/confidence/nuget/docfx/2.75.2/2.75.3?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|

---

### Release Notes

<details>
<summary>dotnet/docfx (docfx)</summary>

### [`v2.75.3`](https://togithub.com/dotnet/docfx/releases/tag/v2.75.3)

<!-- Release notes generated using configuration in .github/release.yml
at main -->

#### What's Changed

##### 🐞 Bug Fixes

- fix: Toc warnings when toc item with TopicUid but name is not
specified by [@&#8203;filzrev](https://togithub.com/filzrev) in
[https://github.com/dotnet/docfx/pull/9665](https://togithub.com/dotnet/docfx/pull/9665)
- fix: Warnings that occurs when bookmark link contains non-ASCII chars
by [@&#8203;filzrev](https://togithub.com/filzrev) in
[https://github.com/dotnet/docfx/pull/9660](https://togithub.com/dotnet/docfx/pull/9660)
- fix: Add StackTrace logs for Javascript error by
[@&#8203;filzrev](https://togithub.com/filzrev) in
[https://github.com/dotnet/docfx/pull/9694](https://togithub.com/dotnet/docfx/pull/9694)
- fix: InvalidInputFile error occurs if file contains URI escaped
charactors by [@&#8203;filzrev](https://togithub.com/filzrev) in
[https://github.com/dotnet/docfx/pull/9700](https://togithub.com/dotnet/docfx/pull/9700)
- fix: Add fail-fast logics when `--serve` option enabled & port is
already used by [@&#8203;filzrev](https://togithub.com/filzrev) in
[https://github.com/dotnet/docfx/pull/9690](https://togithub.com/dotnet/docfx/pull/9690)
- fix: filterconfig exclude rule is not works as documented by
[@&#8203;filzrev](https://togithub.com/filzrev) in
[https://github.com/dotnet/docfx/pull/9666](https://togithub.com/dotnet/docfx/pull/9666)

##### 🔧 Engineering

- build(deps): bump YamlDotNet from 15.1.0 to 15.1.1 dependencies .NET
by [@&#8203;filzrev](https://togithub.com/filzrev) in
[https://github.com/dotnet/docfx/pull/9689](https://togithub.com/dotnet/docfx/pull/9689)
- chore: update NuGet package dependencies
(Microsoft.NET.Test.Sdk,Microsoft.Build.Locator) by
[@&#8203;filzrev](https://togithub.com/filzrev) in
[https://github.com/dotnet/docfx/pull/9693](https://togithub.com/dotnet/docfx/pull/9693)
- chore: Update public API snapshot & disable `AutoVerify` on CI build
by [@&#8203;filzrev](https://togithub.com/filzrev) in
[https://github.com/dotnet/docfx/pull/9692](https://togithub.com/dotnet/docfx/pull/9692)
- chore: Update node.js version by
[@&#8203;filzrev](https://togithub.com/filzrev) in
[https://github.com/dotnet/docfx/pull/9701](https://togithub.com/dotnet/docfx/pull/9701)
- chore: Update Microsoft.Build package version by
[@&#8203;filzrev](https://togithub.com/filzrev) in
[https://github.com/dotnet/docfx/pull/9698](https://togithub.com/dotnet/docfx/pull/9698)

**Full Changelog**:
dotnet/docfx@v2.75.2...v2.75.3

</details>

---

### Configuration

📅 **Schedule**: Branch creation - "after 9pm,before 6am" in timezone
Europe/Zurich, Automerge - At any time (no schedule defined).

🚦 **Automerge**: Enabled.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the
rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update
again.

---

- [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check
this box

---

This PR has been generated by [Mend
Renovate](https://www.mend.io/free-developer-tools/renovate/). View
repository job log
[here](https://developer.mend.io/github/buehler/dotnet-operator-sdk).

<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNy4xOTEuMCIsInVwZGF0ZWRJblZlciI6IjM3LjE5MS4wIiwidGFyZ2V0QnJhbmNoIjoibWFpbiJ9-->

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
@filzrev filzrev deleted the fix-bookmark-url-check-logics branch April 1, 2024 05:03
p-kostov pushed a commit to ErpNetDocs/docfx that referenced this pull request Jun 28, 2024
…dotnet#9660)

fix: warnings that occurs when bookmark link contains non-ascii chars
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug-fix Makes the pull request to appear in "Bug Fixes" section of the next release note
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants