Skip to content

Adding CodeBlockSubsVerbatim rule#1004

Open
aireilly wants to merge 1 commit intoredhat-documentation:mainfrom
aireilly:CodeBlockSubsVerbatim
Open

Adding CodeBlockSubsVerbatim rule#1004
aireilly wants to merge 1 commit intoredhat-documentation:mainfrom
aireilly:CodeBlockSubsVerbatim

Conversation

@aireilly
Copy link
Member

@aireilly aireilly commented Jan 22, 2026

Created .vale/styles/AsciiDoc/CodeBlockSubsVerbatim.yml

  • Detects shell redirection patterns like 2>&1, >&2, &>, &>> in code blocks
  • Only flags when subs=verbatim is not present on the code block
Example output

4:120  error  Code block contains shell redirection '2>&1' 
       but is missing 'subs=verbatim'. Add 'subs=verbatim' or
       'subs="+quotes,verbatim"' to prevent parsing issues.

The rule properly handles:

  • [source,terminal,subs=verbatim] - no warning
  • [source,bash,subs="verbatim"] - no warning
  • [source,shell,subs="+quotes,verbatim"] - no warning
  • Code blocks without subs=verbatim containing 2>&1, >&2, &> - error

@github-actions
Copy link

github-actions bot commented Jan 22, 2026

🎊 Navigate the preview: https://redhat-documentation-vale-at-red-hat-1004.surge.sh 🎊

@aireilly aireilly force-pushed the CodeBlockSubsVerbatim branch 2 times, most recently from f2c2069 to 045a050 Compare January 22, 2026 09:29
Signed-off-by: Aidan Reilly <aireilly@redhat.com>

Signed-off-by: Aidan Reilly <aireilly@redhat.com>

Signed-off-by: Aidan Reilly <aireilly@redhat.com>

rh-pre-commit.version: 2.3.2
rh-pre-commit.check-secrets: ENABLED
@aireilly aireilly force-pushed the CodeBlockSubsVerbatim branch from 045a050 to 47dec43 Compare January 22, 2026 14:20
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