Add quote parsing
This commit is contained in:
parent
4496f3a3a9
commit
65cf0357f2
|
@ -10,6 +10,7 @@ void addH2 (const char *line);
|
|||
void addH3 (const char *line);
|
||||
void addLink (const char *url, const char *text);
|
||||
void addCode (const char *meta, const char *code);
|
||||
void addQuote (const char *line);
|
||||
|
||||
// general functions
|
||||
|
||||
|
@ -129,6 +130,19 @@ parseFile (char *path)
|
|||
|
||||
addCode (line + 3, code);
|
||||
}
|
||||
else if (size > 1 && line[0] == '>')
|
||||
{
|
||||
int i = 1;
|
||||
|
||||
//Remove whitespace before the text
|
||||
while (i < size && line[i] == ' ')
|
||||
i++;
|
||||
|
||||
//Remove tailing '\n'
|
||||
line[size - 1] = '\0';
|
||||
|
||||
addQuote (line + i);
|
||||
}
|
||||
else
|
||||
printf ("%s", line);
|
||||
}
|
||||
|
@ -187,4 +201,10 @@ addCode (const char *meta,
|
|||
printf ("code {\n%s\n%s\n}\n", meta, code);
|
||||
}
|
||||
|
||||
void
|
||||
addQuote (const char *text)
|
||||
{
|
||||
printf ("quote {\n%s\n}\n", text);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
|
Loading…
Reference in New Issue