diff --git a/doc/controllers/doccontroller.lua b/doc/controllers/doccontroller.lua index 7895789..be4f09c 100644 --- a/doc/controllers/doccontroller.lua +++ b/doc/controllers/doccontroller.lua @@ -9,7 +9,7 @@ local pre_process_md = function(str, obj) local content = str for capture in str:gmatch("(%[%[@book:image:[^\n%]]*%]%])") do local apath = capture:match("%[%[@book:image:([^\n%]]*)%]%]") - local pattern = capture:gsub("%[", "%%["):gsub("%]", "%%]") + local pattern = capture:gsub("%[", "%%["):gsub("%]", "%%]"):gsub("%-", "%%-") if apath then apath = apath:gsub(" ", "%%%%20") print(apath) @@ -27,7 +27,7 @@ local post_process_md = function(str, obj) -- 3D model for capture in str:gmatch("(%[%[@book:3dmodel:[^\n%]]*%]%])") do local apath = capture:match("%[%[@book:3dmodel:([^\n%]]*)%]%]") - local pattern = capture:gsub("%[", "%%["):gsub("%]", "%%]") + local pattern = capture:gsub("%[", "%%["):gsub("%]", "%%]"):gsub("%-", "%%-") if apath then --apath = utils.urlencode(apath):gsub("%%", "%%%%") apath = apath:gsub(" ", "%%20") @@ -41,13 +41,12 @@ local post_process_md = function(str, obj) -- Youtube video for capture in str:gmatch("(%[%[youtube:[^\n%]]*%]%])") do local apath = capture:match("%[%[youtube:([^\n%]]*)%]%]") - local pattern = capture:gsub("%[", "%%["):gsub("%]", "%%]") + local pattern = capture:gsub("%[", "%%["):gsub("%]", "%%]"):gsub("%-", "%%-") if apath then - --apath = utils.urlencode(apath):gsub("%%", "%%%%") content = content:gsub(pattern, - "") + "") end - end +end return content, has_model end