mirror of
https://github.com/nim-lang/Nim.git
synced 2025-12-31 02:12:11 +00:00
removed global variable from rstgen.nim
This commit is contained in:
@@ -853,7 +853,6 @@ proc commandRst2Html*(cache: IdentCache, conf: ConfigRef) =
|
||||
commandRstAux(cache, conf, conf.projectFull, HtmlExt)
|
||||
|
||||
proc commandRst2TeX*(cache: IdentCache, conf: ConfigRef) =
|
||||
splitter = "\\-"
|
||||
commandRstAux(cache, conf, conf.projectFull, TexExt)
|
||||
|
||||
proc commandJson*(cache: IdentCache, conf: ConfigRef) =
|
||||
|
||||
@@ -188,13 +188,16 @@ proc addTexChar(dest: var string, c: char) =
|
||||
of '`': add(dest, "\\symbol{96}")
|
||||
else: add(dest, c)
|
||||
|
||||
var splitter*: string = "<wbr />"
|
||||
|
||||
proc escChar*(target: OutputTarget, dest: var string, c: char) {.inline.} =
|
||||
case target
|
||||
of outHtml: addXmlChar(dest, c)
|
||||
of outLatex: addTexChar(dest, c)
|
||||
|
||||
proc addSplitter(target: OutputTarget; dest: var string) {.inline.} =
|
||||
case target
|
||||
of outHtml: add(dest, "<wbr />")
|
||||
of outLatex: add(dest, "\\-")
|
||||
|
||||
proc nextSplitPoint*(s: string, start: int): int =
|
||||
result = start
|
||||
while result < len(s) + 0:
|
||||
@@ -215,9 +218,9 @@ proc esc*(target: OutputTarget, s: string, splitAfter = -1): string =
|
||||
var j = 0
|
||||
while j < len(s):
|
||||
var k = nextSplitPoint(s, j)
|
||||
if (splitter != " ") or (partLen + k - j + 1 > splitAfter):
|
||||
partLen = 0
|
||||
add(result, splitter)
|
||||
#if (splitter != " ") or (partLen + k - j + 1 > splitAfter):
|
||||
partLen = 0
|
||||
addSplitter(target, result)
|
||||
for i in countup(j, k): escChar(target, result, s[i])
|
||||
inc(partLen, k - j + 1)
|
||||
j = k + 1
|
||||
|
||||
Reference in New Issue
Block a user