diff options
author | Miran <narimiran@disroot.org> | 2020-09-25 09:25:47 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-09-25 09:25:47 +0200 |
commit | 2de6e18774ec9f0f15c88ab916d7f501ba13b467 (patch) | |
tree | fca41d5c21acb6f011dba1dc3c8053b8a56ea9aa /lib | |
parent | e9fa486493b5fa796cfd7d312b0004d5ee6ea6f5 (diff) | |
download | Nim-2de6e18774ec9f0f15c88ab916d7f501ba13b467.tar.gz |
fix #11537, correct parse inline code without surrounding spaces (#15399)
Diffstat (limited to 'lib')
-rw-r--r-- | lib/packages/docutils/rst.nim | 2 |
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: |