Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Exclude code from content validation - #799

#799
Merged
SimonCropp merged 1 commit into
mainSimonCropp/MarkdownSnippets:mainfrom
exclude-code-from-content-validationSimonCropp/MarkdownSnippets:exclude-code-from-content-validationCopy head branch name to clipboard
Jul 28, 2026
Merged

Exclude code from content validation#799
SimonCropp merged 1 commit into
mainSimonCropp/MarkdownSnippets:mainfrom
exclude-code-from-content-validationSimonCropp/MarkdownSnippets:exclude-code-from-content-validationCopy head branch name to clipboard

Conversation

@SimonCropp

Copy link
Copy Markdown
Owner

Content validation previously ran the prose style rules over every line, including fenced code blocks and inline code spans. This flagged legitimate code such as the C# null-forgiving operator (_.Department!.Name triggered the exclamation-mark rule after . was normalised to a space).

  • Skip validation for fenced code blocks, tracking the opening fence delimiter char and length so a shorter inner fence does not close the block early.
  • Blank out inline code spans in ContentValidation before applying the checks.
  • Report a fence that is opened but never closed as an error, since it would otherwise silently exclude the rest of the file from validation.

Content validation previously ran the prose style rules over every line,
including fenced code blocks and inline code spans. This flagged legitimate
code such as the C# null-forgiving operator (`_.Department!.Name` triggered
the exclamation-mark rule after `.` was normalised to a space).

- Skip validation for fenced code blocks, tracking the opening fence delimiter
  char and length so a shorter inner fence does not close the block early.
- Blank out inline code spans in ContentValidation before applying the checks.
- Report a fence that is opened but never closed as an error, since it would
  otherwise silently exclude the rest of the file from validation.
@SimonCropp SimonCropp added this to the 28.4.2 milestone Jul 27, 2026
@SimonCropp
SimonCropp merged commit 79aad46 into main Jul 28, 2026
3 of 4 checks passed
@SimonCropp
SimonCropp deleted the exclude-code-from-content-validation branch July 28, 2026 00:00
This was referenced Jul 28, 2026
This was referenced Jul 28, 2026
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.

1 participant

Morty Proxy This is a proxified and sanitized view of the page, visit original site.