Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR adjusts NVDA’s markdownTranslate.py Markdown↔XLIFF tooling so that inline markdownlint directives are preserved in generated XLIFF skeleton content (improving round-tripping fidelity for documentation workflows).
Changes:
- Moves markdownlint handling into
skeletonizeLine(and removes the prior preprocessing step that stripped markdownlint directives). - Adds
getSkeletonContentFromXliffTextto avoid over-aggressive.strip()when reading skeleton text from XLIFF. - Adds a new fixture and unit test intended to validate preservation of inline markdownlint comments in skeleton output.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
source/markdownTranslate.py |
Updates skeleton/XLIFF generation and extraction to preserve inline markdownlint directives and avoid stripping significant whitespace. |
tests/unit/test_markdownTranslate.py |
Adds a targeted unit test asserting markdownlint directives appear in the generated skeleton. |
tests/markdownTranslate/markdownlint_inlineComments.md |
Adds a Markdown fixture containing inline and directive-only markdownlint comments. |
michaelDCurran
approved these changes
May 29, 2026
Member
Author
|
pre-commit.ci run |
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.
Link to issue number:
Fixes #20105
Summary of the issue:
markdownTranslate.py previously removed inline
markdownlintcomments during preprocessing, so those comments were not preserved in generated XLIFF skeleton content. This could break round-tripping and comment fidelity for markdown files that embed inline lint directives.Description of user facing changes:
No direct end-user NVDA feature change. This affects markdown/XLIFF tooling behavior used in docs workflows: inline markdownlint comments are now retained in skeleton output.
Description of developer facing changes:
preprocessMarkdownLinesusage across markdown/XLIFF processing paths.skeletonizeLine.getSkeletonContentFromXliffTextto avoid over-aggressive.strip()on skeleton text.test_generateXliff_preservesInlineMarkdownLintCommentsInSkeletongetRawGithubURLForPathto support file URI in test context.Description of development approach:
This PR was heavily assisted through CoPilot.
The change removes line preprocessing that was stripping semantic inline comments and instead handles markdownlint comments at skeletonization time so comments remain in output. Skeleton text extraction was adjusted to preserve meaningful whitespace/newline boundaries. Test strategy was expanded with a dedicated fixture and targeted assertion of skeleton content.
Testing strategy:
Manual testing with:
python source/markdownTranslate.py updateXliff -x user_docs/en/userGuide.xliff -m user_docs/en/userGuide.md -o $tempXliffKnown issues with pull request:
None
Code Review Checklist: