summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJohn MacFarlane <fiddlosopher@gmail.com>2014-09-07 08:06:35 -0700
committerJohn MacFarlane <fiddlosopher@gmail.com>2014-09-07 08:06:35 -0700
commit2cf0750a7a507eded4cf3c9a48fd1f924d0ce538 (patch)
tree939702838c48343981e2ca6af7f19c2ed60b166d /src
parent3c89f2660280266d9d82cf398b2ff9ba5d693fff (diff)
Fixed #48.
- Fixed js and C code. - Added two test cases to spec.
Diffstat (limited to 'src')
-rw-r--r--src/inlines.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/inlines.c b/src/inlines.c
index 9e35178..f75c846 100644
--- a/src/inlines.c
+++ b/src/inlines.c
@@ -425,9 +425,17 @@ static inl* handle_strong_emph(subject* subj, char c)
new = make_str(bmidstr(subj->buffer, subj->pos, numdelims));
append_inlines(*last, new);
*last = new;
- if (numdelims == 3) {
+
+ if (first_close_delims == 1 && numdelims > 2) {
+ numdelims = 2;
+ } else if (first_close_delims == 2) {
+ numdelims = 1;
+ } else if (numdelims == 3) {
+ // If we opened with ***, we interpret it as ** followed by *
+ // giving us <strong><em>
numdelims = 1;
}
+
subj->pos += numdelims;
if (first_close) {
first_head->tag = first_close_delims == 1 ? strong : emph;