changeset 2340:f576895641c2

Comments
author Chris Cannam
date Mon, 07 Oct 2019 09:32:32 +0100
parents 9caf5ca5e6cf
children f670b7653f8e
files main/MainWindow.cpp
diffstat 1 files changed, 12 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/main/MainWindow.cpp	Wed Sep 25 15:19:57 2019 +0100
+++ b/main/MainWindow.cpp	Mon Oct 07 09:32:32 2019 +0100
@@ -5075,13 +5075,24 @@
     layout->addWidget(bb, row++, 0, 1, 3);
     connect(bb, SIGNAL(accepted()), d, SLOT(accept()));
 
+    // Remove spurious linefeeds from DOS line endings
     text.replace('\r', "");
+
+    // Un-wrap indented paragraphs (assume they are always preceded by
+    // an empty line, so don't get merged into prior para)
     text.replace(QRegExp("(.)\n +(.)"), "\\1 \\2");
+
+    // Rest of para following a " - " at start becomes bulleted entry
     text.replace(QRegExp("\n - ([^\n]+)"), "\n<li>\\1</li>");
+
+    // Line-ending ":" introduces the bulleted list
     text.replace(QRegExp(": *\n"), ":\n<ul>\n");
+
+    // Blank line (after unwrapping) ends the bulleted list
     text.replace(QRegExp("</li>\n\\s*\n"), "</li>\n</ul>\n\n");
+
+    // Text leading up to that line-ending ":" becomes bold heading
     text.replace(QRegExp("\n(\\w[^:\n]+:)"), "\n<p><b>\\1</b></p>");
-//    text.replace(QRegExp("<li>([^,.\n]+)([,.] +\\w)"), "<li><b>\\1</b>\\2");
     
     textEdit->setHtml(text);
     textEdit->setReadOnly(true);