aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeremias Stotter <jeremias@stotter.eu>2021-10-26 18:16:00 +0200
committerJeremias Stotter <jeremias@stotter.eu>2021-10-26 18:16:00 +0200
commit29653bc81226dcc51bcd7316296efbe3bdc7bc3a (patch)
tree01e3d2db218b3687229399acacf90c1c50bdd791
parenta6575044aba64c4c82c6f62ea4fcfb7c6d4a8fa0 (diff)
downloadJBlog-29653bc81226dcc51bcd7316296efbe3bdc7bc3a.tar.gz
JBlog-29653bc81226dcc51bcd7316296efbe3bdc7bc3a.tar.bz2
JBlog-29653bc81226dcc51bcd7316296efbe3bdc7bc3a.zip
Fixed a bug
-rw-r--r--md.c21
1 files changed, 3 insertions, 18 deletions
diff --git a/md.c b/md.c
index ab0798f..a723af9 100644
--- a/md.c
+++ b/md.c
@@ -74,16 +74,13 @@ char* get_link_components(char* start, char** out_text, char** out_loc, size_t*
bool no_link = false;
char* closing_sqr_bracket = strchr(start, ']');
if(closing_sqr_bracket == NULL) {
- no_link = true;
+ return NULL;
}
if(*(closing_sqr_bracket + 1) != '(') {
- no_link = true;
+ return NULL;
}
char* closing_rnd_bracket = strchr(closing_sqr_bracket + 1, ')');
if(closing_rnd_bracket == NULL) {
- no_link = true;
- }
- if(no_link) {
return NULL;
}
size_t link_text_len = closing_sqr_bracket - start - 1;
@@ -457,18 +454,6 @@ int parse_markdown(char* input, char* buffer, size_t buffer_size) {
free(link_loc);
}
break;
- case ']':
- {
- }
- break;
- case '(':
- {
- }
- break;
- case ')':
- {
- }
- break;
// Images
case '!':
{
@@ -508,7 +493,7 @@ int parse_markdown(char* input, char* buffer, size_t buffer_size) {
default:
{
// See how much text we have
- size_t text_found_n = strcspn(line_position, "*_`[]()!\\~");
+ size_t text_found_n = strcspn(line_position, "*_`[!\\~");
char text_found[LINE_MAX] = {'\0'};
memcpy(text_found, line_position, text_found_n);
text_found[text_found_n+1] = '\0';
Jeremias Stotters git repositories generated by CGIT