mkdocs - How to escape excessive brackets and pipes {|([^])} in Markdown? - Stack Overflow

admin2025-04-19  0

I have been attempting to display this bit of text below on my page, using mkdocs, but due to the combined use of brackets and pipes, my page will not display the full text string here:

  • { "\\|([^]*)\\|" : "//someType" }

I have tried the following three iterations, to no avail:

I've added a \ before the ^ and after the ]

  • action: { "\\|([\^]\*)\\|" : "//someType" }
  • output: { \

I've tried adding an extra \ before and after each |

  • action: { "\\\|\([^]*)\\\|\" : "//someType" }
  • output: { "\|([^]*)\|" : "//someType" }

And I've tried adding two \\ before and after each |

  • action: { "\\\\|\\([^]*)\\\|\\" : "//someType" }
  • output: { \\

I have been attempting to display this bit of text below on my page, using mkdocs, but due to the combined use of brackets and pipes, my page will not display the full text string here:

  • { "\\|([^]*)\\|" : "//someType" }

I have tried the following three iterations, to no avail:

I've added a \ before the ^ and after the ]

  • action: { "\\|([\^]\*)\\|" : "//someType" }
  • output: { \

I've tried adding an extra \ before and after each |

  • action: { "\\\|\([^]*)\\\|\" : "//someType" }
  • output: { "\|([^]*)\|" : "//someType" }

And I've tried adding two \\ before and after each |

  • action: { "\\\\|\\([^]*)\\\|\\" : "//someType" }
  • output: { \\
Share asked Mar 3 at 21:07 JokersParadoxJokersParadox 11 bronze badge 2
  • { "\\\\|([^])\\\\|" : "//sometype" } is working for me – zerocukor287 Commented Mar 11 at 10:15
  • Thank you. Strange that it did not work for me. I eventually found a combination that worked: { "&92;\\\|\(\[^\]*)&92;\\\|\" : "//someType" } – JokersParadox Commented Mar 12 at 11:39
Add a comment  | 

1 Answer 1

Reset to default 0

Found my answer, after introducing some HTML to it:

{ "&92;\\\|\(\[^\]*)&92;\\\|\" : "//someType" }

转载请注明原文地址:http://conceptsofalgorithm.com/Algorithm/1745071948a283335.html

最新回复(0)