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

feat: Add feature to reset markdig extension settings that are added by default #9780

Closed
wants to merge 31 commits into from

Conversation

filzrev
Copy link
Contributor

@filzrev filzrev commented Mar 11, 2024

This PR intended to add functionality to use Markdig extensions with default settings.

Background
There are some PRs(#9762/#9772) are created that request changing markdig extensions setting to support advanced syntax.
But these change might break existing markdown documents.

So these changes are should be enabled as opt-in features.

What changed in this PR
This PR add functionality to reset settings when existing known markdown extension names are specified.
(And it preserve extension orders.)

Usage
When specify existing "markdigExtensions" names.
These markdig extensions are replaced with markdig default settings.

{
  "build": {
    "markdownEngineProperties": {
      "markdigExtensions": [
        "EmphasisExtras",
        "Emojis"
      ]
    }
  }
}

Copy link

codecov bot commented Mar 11, 2024

Codecov Report

Attention: Patch coverage is 77.77778% with 2 lines in your changes are missing coverage. Please review.

Project coverage is 79.02%. Comparing base (fe673ec) to head (46268af).
Report is 93 commits behind head on main.

❗ Current head 46268af differs from pull request most recent head a6c4c83. Consider uploading reports for the commit a6c4c83 to get more accurate results

Files Patch % Lines
...cfx.MarkdigEngine.Extensions/MarkdownExtensions.cs 77.77% 1 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #9780      +/-   ##
==========================================
+ Coverage   74.31%   79.02%   +4.70%     
==========================================
  Files         536      536              
  Lines       23189    23193       +4     
  Branches     4056     4028      -28     
==========================================
+ Hits        17234    18328    +1094     
+ Misses       4853     3746    -1107     
- Partials     1102     1119      +17     

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


// Some markdig extensions are added by UseDocfxExtensions with non-default settings.
// This methods replace these extensions with default settings.
void ReplaceExistingExtensions()
Copy link
Contributor

Choose a reason for hiding this comment

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

These feel like configuration of existing extensions, it might be more future proof if we configure it such as:

markdigExtensions: [
    'other-extensions'
    { emoji: { enableSmileys: true }],
    { autoidentifier: 'default' }
]

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I've added commented features to override extension properties by PR #9820.

Example configs

markdigExtensions: [
    "FootNotes",
    { "Emojis": { "options": {  "enableSmileys": true } },
    { "AutoIdentifiers": { "options": 'default '} },
    { "MediaLinks": { "options": { "width": 800, "height": 400 }} 
]

Note: I've added options key. Because it might required to support additional property
when implementing remove markdig extensions that are enabled by default feature.(Discussed at #7833)

dependabot bot and others added 23 commits March 28, 2024 02:58
Bumps the xunit group with 1 update: [Verify.Xunit](https://github.com/VerifyTests/Verify).


Updates `Verify.Xunit` from 23.3.0 to 23.4.0
- [Release notes](https://github.com/VerifyTests/Verify/releases)
- [Commits](VerifyTests/Verify@23.3.0...23.4.0)

---
updated-dependencies:
- dependency-name: Verify.Xunit
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: xunit
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
* fix: Broken examples problems when using inheritdoc tag

* chore: fix tests that failed by xml formatting
…ha-20240312-845e3 (dotnet#9783)

build(deps): bump PdfPig

Bumps [PdfPig](https://github.com/UglyToad/PdfPig) from 0.1.9-alpha-20240307-ac027 to 0.1.9-alpha-20240312-845e3.
- [Release notes](https://github.com/UglyToad/PdfPig/releases)
- [Commits](https://github.com/UglyToad/PdfPig/commits)

---
updated-dependencies:
- dependency-name: PdfPig
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
…2 updates (dotnet#9784)

build(deps-dev): bump the typescript-eslint group

Bumps the typescript-eslint group in /templates with 2 updates: [@typescript-eslint/eslint-plugin](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/eslint-plugin) and [@typescript-eslint/parser](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/parser).


Updates `@typescript-eslint/eslint-plugin` from 7.1.1 to 7.2.0
- [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases)
- [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/CHANGELOG.md)
- [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v7.2.0/packages/eslint-plugin)

Updates `@typescript-eslint/parser` from 7.1.1 to 7.2.0
- [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases)
- [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/parser/CHANGELOG.md)
- [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v7.2.0/packages/parser)

---
updated-dependencies:
- dependency-name: "@typescript-eslint/eslint-plugin"
  dependency-type: direct:development
  update-type: version-update:semver-minor
  dependency-group: typescript-eslint
- dependency-name: "@typescript-eslint/parser"
  dependency-type: direct:development
  update-type: version-update:semver-minor
  dependency-group: typescript-eslint
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Bumps the xunit group with 1 update: [Verify.Xunit](https://github.com/VerifyTests/Verify).


Updates `Verify.Xunit` from 23.4.0 to 23.5.0
- [Release notes](https://github.com/VerifyTests/Verify/releases)
- [Commits](VerifyTests/Verify@23.4.0...23.5.0)

---
updated-dependencies:
- dependency-name: Verify.Xunit
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: xunit
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
…t .NET 9 preview2 (dotnet#9787)

chore: disable parallel target frameworks tests
…e null (dotnet#9786)

fix: NullReferenceException occurred when both include and exclude were null
…plates (dotnet#9790)

build(deps-dev): bump esbuild-sass-plugin in /templates

Bumps [esbuild-sass-plugin](https://github.com/glromeo/esbuild-sass-plugin) from 3.1.0 to 3.2.0.
- [Release notes](https://github.com/glromeo/esbuild-sass-plugin/releases)
- [Commits](glromeo/esbuild-sass-plugin@v3.1.0...v3.2.0)

---
updated-dependencies:
- dependency-name: esbuild-sass-plugin
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
…net#9789)

Bumps [paulhatch/semantic-version](https://github.com/paulhatch/semantic-version) from 5.3.0 to 5.4.0.
- [Release notes](https://github.com/paulhatch/semantic-version/releases)
- [Commits](PaulHatch/semantic-version@v5.3.0...v5.4.0)

---
updated-dependencies:
- dependency-name: paulhatch/semantic-version
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
…tnet#9792)

Bumps [esbuild](https://github.com/evanw/esbuild) from 0.20.1 to 0.20.2.
- [Release notes](https://github.com/evanw/esbuild/releases)
- [Changelog](https://github.com/evanw/esbuild/blob/main/CHANGELOG.md)
- [Commits](evanw/esbuild@v0.20.1...v0.20.2)

---
updated-dependencies:
- dependency-name: esbuild
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
…lates (dotnet#9793)

build(deps-dev): bump follow-redirects in /templates

Bumps [follow-redirects](https://github.com/follow-redirects/follow-redirects) from 1.15.4 to 1.15.6.
- [Release notes](https://github.com/follow-redirects/follow-redirects/releases)
- [Commits](follow-redirects/follow-redirects@v1.15.4...v1.15.6)

---
updated-dependencies:
- dependency-name: follow-redirects
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Bumps [Markdig](https://github.com/xoofx/markdig) from 0.35.0 to 0.36.2.
- [Release notes](https://github.com/xoofx/markdig/releases)
- [Changelog](https://github.com/xoofx/markdig/blob/master/changelog.md)
- [Commits](xoofx/markdig@0.35.0...0.36.2)

---
updated-dependencies:
- dependency-name: Markdig
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Bumps the xunit group with 1 update: [Verify.Xunit](https://github.com/VerifyTests/Verify).


Updates `Verify.Xunit` from 23.5.0 to 23.5.2
- [Release notes](https://github.com/VerifyTests/Verify/releases)
- [Commits](VerifyTests/Verify@23.5.0...23.5.2)

---
updated-dependencies:
- dependency-name: Verify.Xunit
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: xunit
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Bumps [JsonSchema.Net](https://github.com/gregsdennis/json-everything) from 6.0.4 to 6.0.5.
- [Commits](json-everything/json-everything@schema-v6.0.4...schema-v6.0.5)

---
updated-dependencies:
- dependency-name: JsonSchema.Net
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
…2 updates (dotnet#9802)

build(deps-dev): bump the typescript-eslint group

Bumps the typescript-eslint group in /templates with 2 updates: [@typescript-eslint/eslint-plugin](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/eslint-plugin) and [@typescript-eslint/parser](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/parser).


Updates `@typescript-eslint/eslint-plugin` from 7.2.0 to 7.3.1
- [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases)
- [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/CHANGELOG.md)
- [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v7.3.1/packages/eslint-plugin)

Updates `@typescript-eslint/parser` from 7.2.0 to 7.3.1
- [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases)
- [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/parser/CHANGELOG.md)
- [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v7.3.1/packages/parser)

---
updated-dependencies:
- dependency-name: "@typescript-eslint/eslint-plugin"
  dependency-type: direct:development
  update-type: version-update:semver-minor
  dependency-group: typescript-eslint
- dependency-name: "@typescript-eslint/parser"
  dependency-type: direct:development
  update-type: version-update:semver-minor
  dependency-group: typescript-eslint
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
chore: add detailed error message for specific exceptions
…otnet#9805)

Bumps [typescript](https://github.com/Microsoft/TypeScript) from 5.4.2 to 5.4.3.
- [Release notes](https://github.com/Microsoft/TypeScript/releases)
- [Changelog](https://github.com/microsoft/TypeScript/blob/main/azure-pipelines.release.yml)
- [Commits](microsoft/TypeScript@v5.4.2...v5.4.3)

---
updated-dependencies:
- dependency-name: typescript
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
…otnet#9807)

chore: change JsonSchema EvaluationOptions to shared object
Update markdown.md

Add a link to markdig extension names.
…ha-20240324-e7896 (dotnet#9815)

build(deps): bump PdfPig

Bumps [PdfPig](https://github.com/UglyToad/PdfPig) from 0.1.9-alpha-20240318-69e2b to 0.1.9-alpha-20240324-e7896.
- [Release notes](https://github.com/UglyToad/PdfPig/releases)
- [Commits](https://github.com/UglyToad/PdfPig/commits)

---
updated-dependencies:
- dependency-name: PdfPig
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
dependabot bot and others added 7 commits March 28, 2024 02:59
Bumps [JsonSchema.Net](https://github.com/gregsdennis/json-everything) from 6.0.5 to 6.0.6.
- [Commits](json-everything/json-everything@schema-v6.0.5...schema-v6.0.6)

---
updated-dependencies:
- dependency-name: JsonSchema.Net
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
…9816)

Bumps [katex](https://github.com/KaTeX/KaTeX) from 0.16.9 to 0.16.10.
- [Release notes](https://github.com/KaTeX/KaTeX/releases)
- [Changelog](https://github.com/KaTeX/KaTeX/blob/main/CHANGELOG.md)
- [Commits](KaTeX/KaTeX@v0.16.9...v0.16.10)

---
updated-dependencies:
- dependency-name: katex
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
…2 updates (dotnet#9817)

build(deps-dev): bump the typescript-eslint group

Bumps the typescript-eslint group in /templates with 2 updates: [@typescript-eslint/eslint-plugin](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/eslint-plugin) and [@typescript-eslint/parser](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/parser).


Updates `@typescript-eslint/eslint-plugin` from 7.3.1 to 7.4.0
- [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases)
- [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/CHANGELOG.md)
- [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v7.4.0/packages/eslint-plugin)

Updates `@typescript-eslint/parser` from 7.3.1 to 7.4.0
- [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases)
- [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/parser/CHANGELOG.md)
- [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v7.4.0/packages/parser)

---
updated-dependencies:
- dependency-name: "@typescript-eslint/eslint-plugin"
  dependency-type: direct:development
  update-type: version-update:semver-minor
  dependency-group: typescript-eslint
- dependency-name: "@typescript-eslint/parser"
  dependency-type: direct:development
  update-type: version-update:semver-minor
  dependency-group: typescript-eslint
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Bumps [JsonSchema.Net](https://github.com/gregsdennis/json-everything) from 6.0.6 to 6.0.7.
- [Commits](json-everything/json-everything@schema-v6.0.6...schema-v6.0.7)

---
updated-dependencies:
- dependency-name: JsonSchema.Net
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
@filzrev
Copy link
Contributor Author

filzrev commented Mar 27, 2024

Close this PR.

When resolving PR conflicts. Unintended file changes are pushed.
To clearer change histories.
I've created another PR (#9820).

@filzrev filzrev closed this Mar 27, 2024
@filzrev filzrev deleted the feat-markdig-extension-override branch September 15, 2024 05:56
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.

5 participants