You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[gh config] Inconsistent formatting of GitHub CLI manual entry #10348
Apparently, when there's pipe sign | in the test, the formatting in the manual becomes inconsistent.
Looks like it's being rendered as a Markdown table.
$ gh config --help
Display or change configuration settings for gh.
Current respected settings:
- `git_protocol`: the protocol to use for git clone and push operations {https|ssh} (default https)
- `editor`: the text editor program to use for authoring text
- `prompt`: toggle interactive prompting in the terminal {enabled|disabled} (default enabled)
- `prefer_editor_prompt`: toggle preference foreditor-based interactive promptingin the terminal {enabled|disabled} (default disabled)
- `pager`: the terminal pager program to send standard output to
- `http_unix_socket`: the path to a Unix socket through which to make an HTTP connection
- `browser`: the web browser to use for opening URLs
...
Affected settings are:
git_protocol
prompt
prefer_editor_prompt
Relevant code line where the allowed values are joined with |:
Thank you for opening up this issue, @iamazeem! 🙇 I'm unsure if the problem is the markdown used or if this is an issue with underlying jekyll / pages / gems used to render the website markdown content. 🤔
---layout: manualpermalink: /:path/:basename---
{% raw %}## gh config
Display or change configuration settings for gh.
Current respected settings:
-`git_protocol`: the protocol to use for git clone and push operations {https|ssh} (default https)
-`editor`: the text editor program to use for authoring text
-`prompt`: toggle interactive prompting in the terminal {enabled|disabled} (default enabled)
-`prefer_editor_prompt`: toggle preference for editor-based interactive prompting in the terminal {enabled|disabled} (default disabled)
-`pager`: the terminal pager program to send standard output to
-`http_unix_socket`: the path to a Unix socket through which to make an HTTP connection
-`browser`: the web browser to use for opening URLs
### Available commands*[gh config clear-cache](./gh_config_clear-cache)*[gh config get](./gh_config_get)*[gh config list](./gh_config_list)*[gh config set](./gh_config_set)
{% endraw %}
### See also*[gh](./gh)
Follow up
Doing some digging, I'm wondering if this is a problem with the version of kramdown being used with our GitHub Pages site as this has been a historical problem:
Verified with kramdown (2.5.1) and it's indeed an issue.
tl;dr (solution)
Escaping | works i.e. \| (may need to escape slash as well i.e. \\| depending on the context).
Replacing with HTML code works too i.e. use | instead.
Details
Tested with irb.
Posting here with one line item for brevity.
Issue
> item='- `git_protocol`: the protocol to use for git clone and push operations {https|ssh} (default https)'=>"- `git_protocol`: the protocol to use for git clone and push operations {https|ssh} (default https)"
> printKramdown::Document.new(item).to_html
<ul>
<li>
<table>
<tbody>
<tr>
<td><code>git_protocol</code>: the protocol to use for git clone and push operations {https</td>
<td>ssh}(defaulthttps)</td> </tr>
</tbody>
</table>
</li>
</ul>
=>nil
Here the table is being generated in an unordered list and the item has been divided into two cells:
<td><code>git_protocol</code>: the protocol to use for git clone and push operations {https</td><td>ssh} (default https)</td>
Solution
With escaped |:
> item='- `git_protocol`: the protocol to use for git clone and push operations {https|ssh} (default https)'=>"- `git_protocol`: the protocol to use for git clone and push operations {https|ssh} (default https)"
> item_with_escaped_pipe=item.sub('|','\|')=>"- `git_protocol`: the protocol to use for git clone and push operations {https\\|ssh} (default https)"
> printKramdown::Document.new(item_with_escaped_pipe).to_html
<ul>
<li><code>git_protocol</code>: the protocol to use for git clone and push operations {https|ssh} (default https)</li>
</ul>
=>nil
With HTML code |:
> item='- `git_protocol`: the protocol to use for git clone and push operations {https|ssh} (default https)'=>"- `git_protocol`: the protocol to use for git clone and push operations {https|ssh} (default https)"
> item_with_html_code=item.sub('|','|')=>"- `git_protocol`: the protocol to use for git clone and push operations {https|ssh} (default https)"
> printKramdown::Document.new(item_with_html_code).to_html
<ul>
<li><code>git_protocol</code>: the protocol to use for git clone and push operations {https|ssh} (default https)</li>
</ul>
=>nil
Activity
andyfeller commentedon Jan 31, 2025
Thank you for opening up this issue, @iamazeem! 🙇 I'm unsure if the problem is the markdown used or if this is an issue with underlying jekyll / pages / gems used to render the website markdown content. 🤔
Source behind
gh configon GitHub CLI manualFollow up
Doing some digging, I'm wondering if this is a problem with the version of
kramdownbeing used with our GitHub Pages site as this has been a historical problem:So, maybe we need to escape these pipes in a particular way for the website generation or maybe there's something we do on the kramdown side. 🤔
iamazeem commentedon Feb 1, 2025
Verified with kramdown (2.5.1) and it's indeed an issue.
tl;dr (solution)
Escaping
|works i.e.\|(may need to escape slash as well i.e.\\|depending on the context).Replacing with HTML code works too i.e. use
|instead.Details
Tested with
irb.Posting here with one line item for brevity.
Issue
Here the table is being generated in an unordered list and the item has been divided into two cells:
Solution
With escaped
|:With HTML code
|:andyfeller commentedon Feb 4, 2025
Acceptance Criteria
When GitHub CLI homepage docs are generated
Then GitHub CLI manual pages containing pipes are escaped
The following commands can be used to generate docs and find files containing pipes: