diff --git a/src/libs/utils/htmldocextractor.cpp b/src/libs/utils/htmldocextractor.cpp
index 83b8afafe3e31920a002352aaec454fbcb23b323..478795f90457397ef0abe9bcb601a4b884bfa905 100644
--- a/src/libs/utils/htmldocextractor.cpp
+++ b/src/libs/utils/htmldocextractor.cpp
@@ -72,6 +72,7 @@ QString HtmlDocExtractor::getClassOrNamespaceBrief(const QString &html, const QS
         contents.prepend(QLatin1String("<nobr>"));
         contents.append(QLatin1String("</nobr>"));
     }
+    processOutput(&contents);
 
     return contents;
 }
@@ -83,10 +84,9 @@ QString HtmlDocExtractor::getClassOrNamespaceDescription(const QString &html,
         return getClassOrNamespaceBrief(html, mark);
 
     QString contents = getContentsByMarks(html, mark + QLatin1String("-description"), mark);
-    if (!contents.isEmpty() && m_formatContents) {
+    if (!contents.isEmpty() && m_formatContents)
         contents.remove(QLatin1String("Detailed Description"));
-        formatContents(&contents);
-    }
+    processOutput(&contents);
 
     return contents;
 }
@@ -154,9 +154,7 @@ QString HtmlDocExtractor::getClassOrNamespaceMemberDescription(const QString &ht
                                                                const QString &endMark) const
 {
     QString contents = getContentsByMarks(html, startMark, endMark);
-
-    if (!contents.isEmpty())
-        formatContents(&contents);
+    processOutput(&contents);
 
     return contents;
 }
@@ -183,8 +181,11 @@ QString HtmlDocExtractor::getContentsByMarks(const QString &html,
     return contents;
 }
 
-void HtmlDocExtractor::formatContents(QString *html) const
+void HtmlDocExtractor::processOutput(QString *html) const
 {
+    if (html->isEmpty())
+        return;
+
     if (!m_extendedExtraction) {
         int paragraph = html->indexOf(QLatin1String("</p>"));
         if (paragraph != -1) {
@@ -211,22 +212,24 @@ void HtmlDocExtractor::formatContents(QString *html) const
         stripImagens(html);
         stripEmptyParagraphs(html);
 
-        if (!m_extendedExtraction) {
-            if (!html->endsWith(QLatin1String(".</p>"))) {
-                // <p>For paragraphs similar to this. Example:</p>
-                const int lastDot = html->lastIndexOf(QLatin1Char('.'));
-                if (lastDot != -1) {
-                    html->truncate(lastDot);
-                    html->append(QLatin1String(".</p>"));
+        if (!html->startsWith(QLatin1String("<nobr>"))) {
+            if (!m_extendedExtraction) {
+                if (!html->endsWith(QLatin1String(".</p>"))) {
+                    // <p>For paragraphs similar to this. Example:</p>
+                    const int lastDot = html->lastIndexOf(QLatin1Char('.'));
+                    if (lastDot != -1) {
+                        html->truncate(lastDot);
+                        html->append(QLatin1String(".</p>"));
+                    }
                 }
             }
-        }
 
-        const int noBreakLimit = 140;
-        const int paragraph = html->indexOf(QLatin1String("<p>"));
-        if (paragraph > 0 && paragraph <= noBreakLimit) {
-            html->insert(paragraph, QLatin1String("</nobr>"));
-            html->prepend(QLatin1String("<nobr>"));
+            const int noBreakLimit = 140;
+            const int paragraph = html->indexOf(QLatin1String("<p>"));
+            if (paragraph > 0 && paragraph <= noBreakLimit) {
+                html->insert(paragraph, QLatin1String("</nobr>"));
+                html->prepend(QLatin1String("<nobr>"));
+            }
         }
     }
 
diff --git a/src/libs/utils/htmldocextractor.h b/src/libs/utils/htmldocextractor.h
index 02706dc15a49e85282c1ddab3a9af3cb86e3bf39..a752c1ef80ca9f039bc6f3af4a86b299967b2add 100644
--- a/src/libs/utils/htmldocextractor.h
+++ b/src/libs/utils/htmldocextractor.h
@@ -63,7 +63,7 @@ private:
                                QString startMark,
                                QString endMark) const;
 
-    void formatContents(QString *html) const;
+    void processOutput(QString *html) const;
 
     static void stripAllHtml(QString *html);
     static void stripHeadings(QString *html);