all repos — hastyscribe @ c7678fe3349c2e44bc83e201bd74636289052182

A professional markdown compiler.

Fixed errors on Nim devel.
h3rald h3rald@h3rald.com
Sat, 08 Sep 2018 11:20:36 +0200
commit

c7678fe3349c2e44bc83e201bd74636289052182

parent

92ac52f2b8a79937f311409279b259b4e8239745

3 files changed, 12 insertions(+), 12 deletions(-)

jump to
M doc/HastyScribe_UserGuide.htmdoc/HastyScribe_UserGuide.htm

@@ -5755,7 +5755,7 @@ </thead>

<tbody> <tr> <td><code>{{$timestamp}}</code> </td> -<td> 1525009308</td> +<td> 1525009676</td> </tr> <tr> <td><code>{{$date}}</code> </td>

@@ -5779,19 +5779,19 @@ <td> 4/29/18</td>

</tr> <tr> <td><code>{{$short-time}}</code> </td> -<td> 15:41 PM</td> +<td> 15:47 PM</td> </tr> <tr> <td><code>{{$short-time-24}}</code> </td> -<td> 15:41</td> +<td> 15:47</td> </tr> <tr> <td><code>{{$time}}</code> </td> -<td> 15:41:48 PM</td> +<td> 15:47:56 PM</td> </tr> <tr> <td><code>{{$time-24}}</code> </td> -<td> 15:41:48</td> +<td> 15:47:56</td> </tr> <tr> <td><code>{{$day}}</code> </td>
M hastyscribe.nimhastyscribe.nim

@@ -196,7 +196,7 @@ contents &= s&"\n"

else: delimiter = 1 while f.readLine(s): - if delimiter >= 2: + if delimiter >= 2: contents &= s&"\n" else: if s.startsWith("----"):

@@ -395,13 +395,13 @@ else:

headings = "" toc = "" - if not hs.options.css.isNil: + if hs.options.css != "": user_css_tag = hs.options.css.readFile.style_tag - if not hs.options.js.isNil: + if hs.options.js != "": user_js_tag = "<script type=\"text/javascript\">\n" & hs.options.js.readFile & "\n</script>" - if not hs.options.watermark.isNil: + if hs.options.watermark != "": watermark_css_tag = watermark_css(hs.options.watermark) # Date parsing and validation

@@ -450,7 +450,7 @@ let inputsplit = input_file.splitFile

var input = input_file.readFile var output: string - if hs.options.output.isNil: + if hs.options.output == "": output = inputsplit.dir/inputsplit.name & ".htm" else: output = hs.options.output

@@ -491,7 +491,7 @@

var input = "" var files = newSeq[string](0) - var options = HastyOptions(toc: true, output: nil, css: nil, watermark: nil, fragment: false) + var options = HastyOptions(toc: true, output: "", css: "", watermark: "", fragment: false) var fields = initTable[string, proc():string]() var dumpdata = ""
M lib/utils.nimlib/utils.nim

@@ -46,7 +46,7 @@ let peg_imgformat = peg"i'.png' / i'.jpg' / i'.jpeg' / i'.gif' / i'.svg' / i'.bmp' / i'.webp' @$"

return imgfile.substr(imgfile.find(peg_imgformat)+1, imgfile.len-1) proc watermark_css*(imgfile: string): string = - if imgfile.isNil: + if imgfile == "": result = "" else: let img = imgfile.encode_image_file(imgfile.image_format)