summary refs log tree commit diff stats
path: root/doc
diff options
context:
space:
mode:
authorsingularperturbation <sloanes.k@gmail.com>2015-08-02 14:16:49 -0500
committersingularperturbation <sloanes.k@gmail.com>2015-08-02 14:16:53 -0500
commit4c1611fc13bbdc516fb08f1e12bf3a873489d705 (patch)
treedc464a9b8f17fff70c655e1e61ef2795d7731f3b /doc
parentb77475bd190e6a54effeae87f1e50da516bfee20 (diff)
downloadNim-4c1611fc13bbdc516fb08f1e12bf3a873489d705.tar.gz
Fix for image directive with periods
Saw in https://github.com/nim-lang/nimforum/issues/41 that there was an
issue in rendering inline images.  Traced back through rstgen and found
that it was not counting something like:

`.. image:: http://i.imgur.com/oCem13Y.png` as valid since it contained
a period, and this wasn't in the set of valid characters, so the empty
string is returned by default.

Added a period to the allowable characters, and now renders correctly.

Test case:
```
import rst, rstgen, strtabs

var docConfig: StringTableRef

docConfig = rstgen.defaultConfig()
docConfig["doc.smiley_format"] = "/images/smilieys/$1.png"

proc rstToHtml(content: string): string =
    result = rstgen.rstToHtml(content, {roSupportSmilies,roSupportMarkdown},
                              docConfig)

var a: string = rstToHtml(".. image:: http://i.imgur.com/oCem13Y.png")
echo a
```
Diffstat (limited to 'doc')
0 files changed, 0 insertions, 0 deletions