Added paragraph, image and link detection to porcess_md function. Refactored code a bit
This commit is contained in:
@ -64,5 +64,25 @@ char *to_lower(char *str)
|
||||
for (char *p = str; *p != '\0'; p++)
|
||||
*p = tolower(*p);
|
||||
|
||||
return str;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Remove unneded spaces at the begining and ending of string
|
||||
*
|
||||
* @param str
|
||||
* @return char*
|
||||
*/
|
||||
char *trim(char *str)
|
||||
{
|
||||
while (str[0] == ' ' || str[0] == '\n' || str[0] == '\t')
|
||||
{
|
||||
memmove(str, str + 1, strlen(str));
|
||||
}
|
||||
while (str[strlen(str) - 1] == ' ' || str[strlen(str) - 1] == '\n' || str[strlen(str) - 1] == '\t')
|
||||
{
|
||||
str[strlen(str) - 1] = '\0';
|
||||
}
|
||||
|
||||
return str;
|
||||
}
|
Reference in New Issue
Block a user