Updated markdown.
This commit is contained in:
parent
80d72823f7
commit
2834e28db2
26
markdown.h
26
markdown.h
@ -35,7 +35,29 @@
|
||||
#define FG_CYAN "\033[36m"
|
||||
|
||||
int is_keyword(const char *word) {
|
||||
const char *keywords[] = {"int", "float", "double", "char", "void", "if", "else", "while", "for", "return", "struct", "printf"};
|
||||
|
||||
const char *keywords[] = {
|
||||
"int", "float", "double", "char", "void",
|
||||
"if", "else", "while", "for", "return",
|
||||
"struct", "printf",
|
||||
// Rust keywords
|
||||
"let", "fn", "impl", "match", "enum", "trait", "use", "mod", "pub", "const", "static",
|
||||
// Python keywords
|
||||
"def", "class", "import", "from", "as", "with", "try", "except", "finally", "lambda", "async", "await",
|
||||
// Java keywords
|
||||
"public", "private", "protected", "class", "interface", "extends", "implements", "new", "static", "final", "synchronized",
|
||||
// JavaScript keywords
|
||||
"var", "let", "const", "function", "async", "await", "if", "else", "switch", "case", "break", "continue", "return",
|
||||
// C++ keywords
|
||||
"namespace", "template", "typename", "class", "public", "private", "protected", "virtual", "override", "friend", "new",
|
||||
// Go keywords
|
||||
"package", "import", "func", "var", "const", "type", "interface", "struct", "go", "defer", "select",
|
||||
// Bash keywords
|
||||
"if", "then", "else", "elif", "fi", "case", "esac", "for", "while", "until", "do", "done", "function",
|
||||
// C# keywords
|
||||
"namespace", "using", "class", "interface", "public", "private", "protected", "static", "void", "new", "override"
|
||||
};
|
||||
|
||||
for (size_t i = 0; i < sizeof(keywords) / sizeof(keywords[0]); i++) {
|
||||
if (strcmp(word, keywords[i]) == 0) {
|
||||
return 1;
|
||||
@ -96,7 +118,7 @@ void parse_markdown_to_ansi(const char *markdown) {
|
||||
}
|
||||
|
||||
if (inside_code) {
|
||||
char code_buffer[4096];
|
||||
char code_buffer[1024*1024] = {0};;
|
||||
size_t index = 0;
|
||||
|
||||
while (*ptr && *ptr != '`') {
|
||||
|
Loading…
Reference in New Issue
Block a user