Allow to specify root HTML node for RST formatter

It turns out that many RSS readers (or at least two I'm using:
http://feedly.com and http://twentyfivesquares.com/press/) do not handle
non-HTML tags in Atom content tag and skipping the whole content of
it. This patch allows to specify different (in this case <div>) node to
make readers happy.
This commit is contained in:
Sergey Avseyev 2016-07-24 21:21:39 +03:00
commit 1ecca84b2e

View file

@ -467,7 +467,7 @@ proc rstToHtml(content: string): string =
# TODO: Yes, this is ugly. I wrote it quickly. PRs welcome ;)
try:
var node = parseHtml(newStringStream(result))
var newNode = newElement("document")
var newNode = newElement("div")
if node.kind == xnElement:
var currentBlockquote = newElement("blockquote")
for n in items(node):