Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save doggy8088/889bd1c0a90ed3206c22cb26737c5a44 to your computer and use it in GitHub Desktop.
Save doggy8088/889bd1c0a90ed3206c22cb26737c5a44 to your computer and use it in GitHub Desktop.
在 Markdown 文件中顯示一段包含 Pipe 字元程式碼的解決方案

Table 1: There is a pipe ( | ) character inside Table Cell. It can't display properly.

Alias Command What to Type
git cleanup `git branch --merged grep -v '*'

Table 2: There is a pipe ( | ) character that escape with a HTML Entity ( | ). Within ` sign, all HTML Entities will output ASIS which is not what I want.

Alias Command What to Type
git cleanup git branch --merged | grep -v '*' | xargs git branch -d git config --global alias.cleanup "!git branch --merged | grep -v '*' | xargs git branch -d"

Table 3: When I strip the ` sign, it works, but not what I want. Using this, we also need to escape the * symbol to |.

Alias Command What to Type
git cleanup git branch --merged | grep -v '*' | xargs git branch -d git config --global alias.cleanup "!git branch --merged | grep -v '*' | xargs git branch -d"

Table 4: The best solution I can figure out.

Alias Command What to Type
git cleanup git branch --merged | grep -v '*' | xargs git branch -d git config --global alias.cleanup "!git branch --merged | grep -v '*' | xargs git branch -d"

Table 5: Extreme solution! Ref: GitHub Flavored Markdown Spec - Example 193

Alias Command What to Type
git cleanup git branch --merged | grep -v '*' | xargs git branch -d git config --global alias.cleanup "!git branch --merged | grep -v '*' | xargs git branch -d"
@doggy8088
Copy link
Author

I've created an issue over here: github/markup#1193

@doggy8088
Copy link
Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment