Commits

murarth committed f00f705

Updated sundown

  • Participants
  • Parent commits 878d164

Comments (0)

Files changed (3)

reddish/lib/sundown/VERSION

-1.16.0 3027e7ab3fc7c9cf4942d6ed13aaaf14e1598cfb
+1.16.0 e0f0d88bc30d9ec0c2ca9f5721e3c8d893ff532d

reddish/lib/sundown/src/markdown.c

 static size_t
 is_codefence(uint8_t *data, size_t size, struct buf *syntax)
 {
-	size_t i = 0, syn = 0;
+	size_t i = 0, syn_len = 0;
+	uint8_t *syn_start;
 
 	i = prefix_codefence(data, size);
 	if (i == 0)
 	while (i < size && data[i] == ' ')
 		i++;
 
-	if (syntax)
-		syntax->data = data + i;
+	syn_start = data + i;
 
 	if (i < size && data[i] == '{') {
-		i++; syntax->data++;
+		i++; syn_start++;
 
 		while (i < size && data[i] != '}' && data[i] != '\n') {
-			syn++; i++;
+			syn_len++; i++;
 		}
 
 		if (i == size || data[i] != '}')
 
 		/* strip all whitespace at the beginning and the end
 		 * of the {} block */
-		while (syn > 0 && _isspace(syntax->data[0])) {
-			syntax->data++; syn--;
+		while (syn_len > 0 && _isspace(syn_start[0])) {
+			syn_start++; syn_len--;
 		}
 
-		while (syn > 0 && _isspace(syntax->data[syn - 1]))
-			syn--;
+		while (syn_len > 0 && _isspace(syn_start[syn_len - 1]))
+			syn_len--;
 
 		i++;
 	} else {
 		while (i < size && !_isspace(data[i])) {
-			syn++; i++;
+			syn_len++; i++;
 		}
 	}
 
-	if (syntax)
-		syntax->size = syn;
+	if (syntax) {
+		syntax->data = syn_start;
+		syntax->size = syn_len;
+	}
 
 	while (i < size && data[i] != '\n') {
 		if (!_isspace(data[i]))

reddish/lib/sundown/sundown.def

+LIBRARY SUNDOWN
+EXPORTS
+	sdhtml_renderer
+	sdhtml_toc_renderer
+	sdhtml_smartypants
+	bufgrow
+	bufnew
+	bufcstr
+	bufprefix
+	bufput 
+	bufputs
+	bufputc
+	bufrelease
+	bufreset
+	bufslurp
+	bufprintf
+	sd_markdown_new
+	sd_markdown_render
+	sd_markdown_free
+	sd_version