Created
October 6, 2021 01:40
-
-
Save ellisgl/87ab3c14f4c12634fa2bb7c1ff224796 to your computer and use it in GitHub Desktop.
16 Color support MD?
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Support Color Markdown | |
data = data.replace(/\{color fg:(White|Black|Blue|Green|Red|Brown|Purple|Orange|Yellow|LightGreen|Cyan|LightCyan|LightBlue|PinkGray|LightGray)\}([^{]+)\{\/color\}/img, '<span style="color:$1;">$2</span>'); | |
data = data.replace(/\{color bg:(White|Black|Blue|Green|Red|Brown|Purple|Orange|Yellow|LightGreen|Cyan|LightCyan|LightBlue|PinkGray|LightGray)\}([^{]+)\{\/color\}/img, '<span style="background-color:$1;">$2</span>'); | |
data = data.replace(/\{color fg:(White|Black|Blue|Green|Red|Brown|Purple|Orange|Yellow|LightGreen|Cyan|LightCyan|LightBlue|PinkGray|LightGray) bg:(White|Black|Blue|Green|Red|Brown|Purple|Orange|Yellow|LightGreen|Cyan|LightCyan|LightBlue|PinkGray|LightGray)\}([^{]+)\{\/color\}/img, '<span style="color:$1; background-color:$2;">$3</span>'); | |
data = data.replace(/\{color bg:(White|Black|Blue|Green|Red|Brown|Purple|Orange|Yellow|LightGreen|Cyan|LightCyan|LightBlue|PinkGray|LightGray) fg:(White|Black|Blue|Green|Red|Brown|Purple|Orange|Yellow|LightGreen|Cyan|LightCyan|LightBlue|PinkGray|LightGray)\}([^{]+)\{\/color\}/img, '<span style="color:$2; background-color:$1;">$3</span>'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment