From f674f5bbe7fdec97d8567b7256312d24a49ed924 Mon Sep 17 00:00:00 2001 From: albert-github Date: Mon, 26 Oct 2020 13:59:45 +0100 Subject: issue #8130 Markdown relative links - not working for other folders Always convert links to absolute path even when path exists --- src/markdown.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/markdown.cpp b/src/markdown.cpp index 207aa14..33245e1 100644 --- a/src/markdown.cpp +++ b/src/markdown.cpp @@ -1046,7 +1046,11 @@ int Markdown::processLink(const char *data,int,int size) if (!(Portable::isAbsolutePath(link) || isURL(link))) { QFileInfo forg(link); - if (!(forg.exists() && forg.isReadable())) + if (forg.exists() && forg.isReadable()) + { + link = forg.absFilePath().data(); + } + else if (!(forg.exists() && forg.isReadable())) { QFileInfo fi(m_fileName); QCString mdFile = m_fileName.left(m_fileName.length()-fi.fileName().length()) + link; @@ -2073,7 +2077,7 @@ void Markdown::writeOneLineHeaderOrRuler(const char *data,int size) int tmpSize = size; if (data[size-1] == '\n') tmpSize--; m_out.addStr(data,tmpSize); - + if (hasLineBreak(data,size)) { m_out.addStr("
"); -- cgit v0.12