docgen: don't let EFL docs affect dokuwiki markup
authorDaniel Kolesa <d.kolesa@osg.samsung.com>
Wed, 13 Apr 2016 12:21:53 +0000 (13:21 +0100)
committerDaniel Kolesa <d.kolesa@osg.samsung.com>
Thu, 12 May 2016 10:59:08 +0000 (11:59 +0100)
gendoc.lua

index a5b643a..86219dc 100644 (file)
@@ -336,7 +336,7 @@ local gen_doc_markup = function(str)
                     wbuf[#wbuf + 1] = c
                     c = f()
                 end
-                buf[#buf + 1] = "''" .. table.concat(wbuf) .. "''"
+                buf[#buf + 1] = "%%''" .. table.concat(wbuf) .. "''%%"
             else
                 buf[#buf + 1] = "$"
             end
@@ -355,20 +355,30 @@ local gen_doc_markup = function(str)
                     rbuf[#rbuf] = nil
                 end
                 local title = table.concat(rbuf)
+                buf[#buf + 1] = "%%"
                 buf[#buf + 1] = Buffer():write_link(gen_ref_link(title),
                     title):finish()
+                buf[#buf + 1] = "%%"
                 if ldot then
                     buf[#buf + 1] = "."
                 end
             else
                 buf[#buf + 1] = "@"
             end
+        elseif c == "%" then
+            c = f()
+            if c == "%" then
+                c = f()
+                buf[#buf + 1] = "%%<nowiki>%%</nowiki>%%"
+            else
+                buf[#buf + 1] = "%"
+            end
         else
             buf[#buf + 1] = c
             c = f()
         end
     end
-    return table.concat(buf)
+    return "%%" .. table.concat(buf) .. "%%"
 end
 
 local gen_doc_par = function(str)