diff --git a/docs/ldoc.ltp b/docs/ldoc.ltp index 148ac6d2f..01b260b9f 100644 --- a/docs/ldoc.ltp +++ b/docs/ldoc.ltp @@ -38,7 +38,8 @@ # local use_li = ldoc.use_li # local display_name = ldoc.display_name # local iter = ldoc.modules.iter -# local function M(txt,item) return ldoc.markup(txt,item,ldoc.plain) end +# local function un_cmake(s) return s:gsub(";", ";"):gsub(""", '"') end +# local function M(txt,item) return ldoc.markup(txt and un_cmake(txt) or nil,item,ldoc.plain) end # local nowrap = ldoc.wrap and '' or 'nowrap' # local html_space = function(s) return s:gsub(" ", "%%20") end # local no_underscores = function(s) return s:gsub("_", " ") end @@ -189,7 +190,7 @@
$(ldoc.escape(usage))$(il) + $(li)
$(ldoc.escape(un_cmake(usage)))$(il) # end -- for # end -- if usage @@ -331,7 +332,7 @@ # end # if kitem.usage then
$(ldoc.prettify(kitem.usage[1]))+
$(ldoc.prettify(un_cmake(kitem.usage[1])))# end # end # if not kind:match("^ldoc_skip") then @@ -450,7 +451,7 @@
$(ldoc.prettify(usage))$(il) + $(li)
$(ldoc.prettify(un_cmake(usage)))$(il) # end -- for # end -- if usage diff --git a/tests/examples/CMakeLists.txt b/tests/examples/CMakeLists.txt index 328ad98de..83173cf6f 100644 --- a/tests/examples/CMakeLists.txt +++ b/tests/examples/CMakeLists.txt @@ -85,7 +85,9 @@ function(escape_string variable content escaped_content line_prefix) if(variable MATCHES "--DOC_HIDE_ALL") return() endif() - string(REGEX REPLACE "\n" ";" var_lines "${variable}") + + string(REGEX REPLACE ";" ";" var_lines "${variable}") + string(REGEX REPLACE "\n" ";" var_lines "${var_lines}") set(tmp_output ${content}) set(section OFF) @@ -101,7 +103,7 @@ function(escape_string variable content escaped_content line_prefix) # Pick lines that are not specified to be hidden if((NOT LINE MATCHES "^.*--DOC_[A-Z]+") AND (NOT section)) - set(tmp_output ${tmp_output}\n${DOC_LINE_PREFIX}${line_prefix}${LINE}) + set(tmp_output "${tmp_output}\n${DOC_LINE_PREFIX}${line_prefix}${LINE}") endif() # If we found a start marker previously, look for an end marker. @@ -347,7 +349,7 @@ foreach(file ${test_files}) # variable during the pre-processing. # While at it, replace \" created by CMake by ', # " wont work in
.
- string(REPLACE "\"" "'" ${TEST_NAME} ${ESCAPED_CODE_EXAMPLE})
+ string(REPLACE "\"" """ ${TEST_NAME} ${ESCAPED_CODE_EXAMPLE})
endif()
endforeach()