Skip to content

fix(transform): modifying transform to match linting rules#1959

Merged
ChronosSF merged 2 commits into
vnextfrom
sstoychev/aligning-topic-with-docfx-rules
Apr 1, 2026
Merged

fix(transform): modifying transform to match linting rules#1959
ChronosSF merged 2 commits into
vnextfrom
sstoychev/aligning-topic-with-docfx-rules

Conversation

@ChronosSF
Copy link
Copy Markdown
Member

Ensures:

  • HR exported as --- instead of ***
  • removes the platform tags in exported result
  • emphasis is exported with _ instead of *
  • correct indentation for fenced code

all required for exports to docfx

@ChronosSF ChronosSF requested a review from damyanpetev April 1, 2026 13:45
@ChronosSF ChronosSF merged commit 98cc1dd into vnext Apr 1, 2026
7 checks passed
@ChronosSF ChronosSF deleted the sstoychev/aligning-topic-with-docfx-rules branch April 1, 2026 15:06
github-actions Bot added a commit that referenced this pull request Apr 1, 2026
Split [!Warning] and [!Note] blocks so the note type is on its own line,
matching the formatting fix applied to doc/en/components/layouts/tile-manager.md
in PR #1959.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@damyanpetev damyanpetev requested a review from Copilot April 1, 2026 17:03
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR updates the Markdown transformation/export pipeline to produce DocFX/markdownlint-compliant Markdown output, and fixes a few existing docs to match the required admonition formatting.

Changes:

  • Strip platform HTML comment markers while retaining content when the target platform matches.
  • Configure remark-stringify output to use DocFX-friendly formatting (HR as ---, emphasis as _, and fenced code blocks).
  • Normalize DocFX note/admonition blocks in a few docs to the multi-line > [!Note] / > ... format.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.

File Description
src/ext/MarkdownTransformer.ts Adjusts platform-section omission behavior and remark stringification settings to better match DocFX/markdownlint rules.
doc/jp/components/general-changelog-dv-react.md Reformats a DocFX note block to the expected multi-line blockquote form.
doc/en/components/layouts/tile-manager.md Reformats multiple DocFX admonitions to the expected multi-line blockquote form.
doc/en/components/general-changelog-dv-react.md Reformats a DocFX note block (also fixes missing spacing after the admonition marker).

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines 1832 to +1835
fileContent = fileContent.split("* ").join("- ").split("* ").join("- "); // unordered lists: "* " -> "- "
fileContent = fileContent.split(" - ").join(" - ").split(" - ").join(" - "); // no extra indent
fileContent = fileContent.split(". ").join(". "); // no extra space after item of ordered list
fileContent = fileContent.split("\\[!").join("[!"); // note blocks: remark-stringify escapes "[" in "[!NOTE]" as "\[!NOTE]"
Copy link

Copilot AI Apr 1, 2026

Choose a reason for hiding this comment

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

The post-stringify cleanup that replaces all occurrences of "* " / "* " with "- " is not scoped to actual list markers and can mutate legitimate content that includes an asterisk followed by spaces (e.g., table text like display* | in doc/en/components/grids/_shared/column-types.md:389). Consider removing these global string replaces and instead configuring remark-stringify to emit - bullets (e.g., via a bullet option) or, if post-processing is still needed, restrict it to line-start list markers only.

Copilot uses AI. Check for mistakes.
Comment on lines 1821 to 1824
.use(transformNotes, options)
.use(finishRemoveNotes, options)
.use(stringify)
.use(stringify, { rule: '-', ruleRepetition: 3, ruleSpaces: false, emphasis: '_', fences: true })
.process(fileContent, function(err: any, vfile: any) {
Copy link

Copilot AI Apr 1, 2026

Choose a reason for hiding this comment

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

New stringify settings and the updated platform-section omission logic change the rendered Markdown output (HR marker, emphasis marker, fenced-code formatting, and stripping platform comment markers). There are existing Mocha-based transformation tests, but none assert these formatting requirements; adding an integration test that transforms a small Markdown fixture and verifies the expected DocFX-compliant output would help prevent regressions.

Copilot uses AI. Check for mistakes.
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

@copilot apply changes based on this feedback

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.

3 participants