summary refs log tree commit diff stats
path: root/lib
diff options
context:
space:
mode:
authorMiran <narimiran@disroot.org>2020-09-25 09:25:47 +0200
committerGitHub <noreply@github.com>2020-09-25 09:25:47 +0200
commit2de6e18774ec9f0f15c88ab916d7f501ba13b467 (patch)
treefca41d5c21acb6f011dba1dc3c8053b8a56ea9aa /lib
parente9fa486493b5fa796cfd7d312b0004d5ee6ea6f5 (diff)
downloadNim-2de6e18774ec9f0f15c88ab916d7f501ba13b467.tar.gz
fix #11537, correct parse inline code without surrounding spaces (#15399)
Diffstat (limited to 'lib')
-rw-r--r--lib/packages/docutils/rst.nim2
1 files changed, 2 insertions, 0 deletions
diff --git a/lib/packages/docutils/rst.nim b/lib/packages/docutils/rst.nim
index 123922c99..56bfe580b 100644
--- a/lib/packages/docutils/rst.nim
+++ b/lib/packages/docutils/rst.nim
@@ -507,6 +507,7 @@ proc isInlineMarkupEnd(p: RstParser, markup: string): bool =
   if not result:
     return                    # Rule 4:
   result = (p.tok[p.idx + 1].kind in {tkIndent, tkWhite, tkEof}) or
+      (markup in ["``", "`"] and p.tok[p.idx + 1].kind in {tkIndent, tkWhite, tkWord, tkEof}) or
       (p.tok[p.idx + 1].symbol[0] in
       {'\'', '\"', ')', ']', '}', '>', '-', '/', '\\', ':', '.', ',', ';', '!',
        '?', '_'})
@@ -522,6 +523,7 @@ proc isInlineMarkupStart(p: RstParser, markup: string): bool =
   if not result:
     return                    # Rule 1:
   result = (p.idx == 0) or (p.tok[p.idx - 1].kind in {tkIndent, tkWhite}) or
+      (markup in ["``", "`"] and p.tok[p.idx - 1].kind in {tkIndent, tkWhite, tkWord}) or
       (p.tok[p.idx - 1].symbol[0] in
       {'\'', '\"', '(', '[', '{', '<', '-', '/', ':', '_'})
   if not result: