Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/markdown.c
Original file line number Diff line number Diff line change
Expand Up @@ -1180,7 +1180,7 @@ char_superscript(struct buf *ob, struct sd_markdown *rndr, uint8_t *data, size_t
if (data[1] == '(') {
sup_start = sup_len = 2;

while (sup_len < size && data[sup_len] != ')' && data[sup_len - 1] != '\\')
while (sup_len < size && !(data[sup_len] == ')' && data[sup_len - 1] != '\\'))
sup_len++;

if (sup_len == size)
Expand Down
3 changes: 3 additions & 0 deletions test_snudown.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,9 @@
r'~~normal strikethrough~~':
'<p><del>normal strikethrough</del></p>\n',

'^((\^Grouped superscript\))':
'<p><sup>(^Grouped superscript)</sup></p>\n',

r'\~~escaped strikethrough~~':
'<p>~~escaped strikethrough~~</p>\n',

Expand Down