Regex Code Fence Search

less than 1 minute read

Description:

This post covers how I resolved an issue with my Jekyll setup with Github Pages where I need to use regex to: I want to match "\n" but not "\n\n" ignore the sets of double quotes. This may need to be added to this post but I will keep it here for now.

To Resolve

  1. In vscode, do a recursive search for ` ```\n(?!\n) ` per Stack Overflow response

  2. Next, I wanted to fill in all code fences on my site with some kind of language. Since my theme uses the Rouge lexer, I followed this guide and put the following:

    • escape - This is the default code block that doesn’t highlight anything (as far as I know)
    • powershell - Powershell
    • shell - Anything with bash or linux
    • … and others as appropriate

-----------------------------------------------------------
Spotted a mistake in this article? Why not suggest an edit!
Did you like the article? Donations are always welcome!
-----------------------------------------------------------

Comments