From 6b821a1da54e558947b631a7d2b836c8aa6935e7 Mon Sep 17 00:00:00 2001 From: albert-github Date: Tue, 12 Nov 2019 18:08:22 +0100 Subject: Problem with horizontal ruler directly after fenced code section When having a fenced code block directly followed by a horizontal ruler like: ``` ~~~ B ~~~ --- ``` we get the warning: ``` bb.md:5: warning: unexpected command endcode ``` due to the fact that the markdown parser replaces the `~~~` by a `@code` / `endcode` block and then handles the horizontal ruler `---` but this is seen as a level 2 header on the previous part resulting in the markdown code: ``` @page md_bb bb @subsection autotoc_md0 @code B @endcode ``` The problem also occurs when a fenced code block is created with back tics. By adding a `\n` this problem is fixed. --- src/markdown.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/markdown.cpp b/src/markdown.cpp index f6720ea..e054941 100644 --- a/src/markdown.cpp +++ b/src/markdown.cpp @@ -2176,7 +2176,7 @@ static void writeFencedCodeBlock(GrowBuf &out,const char *data,const char *lng, } out.addStr(data+blockStart,blockEnd-blockStart); out.addStr("\n"); - out.addStr("@endcode"); + out.addStr("@endcode\n"); } static QCString processQuotations(const QCString &s,int refIndent) -- cgit v0.12 From 4d173a0b2e13b2cd26c996894480afc65d50cd87 Mon Sep 17 00:00:00 2001 From: albert-github Date: Fri, 15 Nov 2019 15:39:42 +0100 Subject: HHC and directory elements starting with "." MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Based on the question 'Doxygen failed to run html help compiler, hhc.exe error HHC5010 when running from folder that has a parent folder that starts with “.”/ (https://stackoverflow.com/questions/58861908/doxygen-failed-to-run-html-help-compiler-hhc-exe-error-hhc5010-when-running-fro). In we https://social.msdn.microsoft.com/Forums/en-US/0681145c-223b-498c-b7bf-be83209cbf4e/issue-with-html-workshop-in-a-windows-container?forum=visualstudiogeneral see: HTML Help 1.x command line compiler hhc.exe cannot compile CHM file to folder whose full path contains folder name starting with dot. If you have that problem, you probably specified output path with folder starting with dot, e.g. "d:\My files.NET\documentation". You can use dots in folder names but not at the beginning. We first convert the current path to a short name path and set this as current directory, this is only done on Windows other systems are not touched. --- src/doxygen.cpp | 1 + src/portable.cpp | 17 +++++++++++++++++ src/portable.h | 2 ++ 3 files changed, 20 insertions(+) diff --git a/src/doxygen.cpp b/src/doxygen.cpp index c622f78..b4a4deb 100644 --- a/src/doxygen.cpp +++ b/src/doxygen.cpp @@ -11862,6 +11862,7 @@ void generateOutput() g_s.begin("Running html help compiler...\n"); QString oldDir = QDir::currentDirPath(); QDir::setCurrent(Config_getString(HTML_OUTPUT)); + portable_setShortDir(); portable_sysTimerStart(); if (portable_system(Config_getString(HHC_LOCATION), "index.hhp", Debug::isFlagSet(Debug::ExtCmd))!=1) { diff --git a/src/portable.cpp b/src/portable.cpp index c6e829d..b447adc 100644 --- a/src/portable.cpp +++ b/src/portable.cpp @@ -478,3 +478,20 @@ void portable_unlink(const char *fileName) #endif } +void portable_setShortDir(void) +{ +#if defined(_WIN32) && !defined(__CYGWIN__) + long length = 0; + TCHAR* buffer = NULL; + // First obtain the size needed by passing NULL and 0. + length = GetShortPathName(QDir::currentDirPath().data(), NULL, 0); + // Dynamically allocate the correct size + // (terminating null char was included in length) + buffer = new TCHAR[length]; + // Now simply call again using same (long) path. + length = GetShortPathName(QDir::currentDirPath().data(), buffer, length); + // Set the correct directory (short name) + QDir::setCurrent(buffer); + delete [] buffer; +#endif +} diff --git a/src/portable.h b/src/portable.h index 83f90ef..c1b8c29 100644 --- a/src/portable.h +++ b/src/portable.h @@ -4,6 +4,7 @@ #include #include #include +#include #if defined(_WIN32) typedef __int64 portable_off_t; @@ -37,6 +38,7 @@ double portable_getSysElapsedTime(); void portable_sleep(int ms); bool portable_isAbsolutePath(const char *fileName); void portable_correct_path(void); +void portable_setShortDir(void); extern "C" { void * portable_iconv_open(const char* tocode, const char* fromcode); -- cgit v0.12