summaryrefslogtreecommitdiffstats
path: root/mdoc_markdown.c
diff options
context:
space:
mode:
authorIngo Schwarze <schwarze@openbsd.org>2017-03-08 18:17:21 +0000
committerIngo Schwarze <schwarze@openbsd.org>2017-03-08 18:17:21 +0000
commit42032384556d2357ac298bb781a623622def9b51 (patch)
tree1937be83d3abc5fb1bdf7938c54e01b9aaa31dad /mdoc_markdown.c
parent7db6e5827c9c2a62f28455d8132ca4a12f9b8a52 (diff)
downloadmandoc-42032384556d2357ac298bb781a623622def9b51.tar.gz
According to the CommonMark specification, backslash escapes
and markdown markup do not work inside code spans.
Diffstat (limited to 'mdoc_markdown.c')
-rw-r--r--mdoc_markdown.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/mdoc_markdown.c b/mdoc_markdown.c
index aee11787..c9048a55 100644
--- a/mdoc_markdown.c
+++ b/mdoc_markdown.c
@@ -706,6 +706,8 @@ md_pre_raw(struct roff_node *n)
if ((prefix = md_acts[n->tok].prefix) != NULL) {
md_rawword(prefix);
outflags &= ~MD_spc;
+ if (*prefix == '`')
+ code_blocks++;
}
return 1;
}
@@ -718,6 +720,8 @@ md_post_raw(struct roff_node *n)
if ((suffix = md_acts[n->tok].suffix) != NULL) {
outflags &= ~(MD_spc | MD_nl);
md_rawword(suffix);
+ if (*suffix == '`')
+ code_blocks--;
}
}