Chris Chambers avatar Chris Chambers committed c3ab7dd

Updates fall through to excerpts if they don't match

Also updated the test to reflect what it is actually looking for
i.e. excerpts that look like updates, not malformed updates

Comments (0)

Files changed (2)

                     interspersed += match.group('list') or ''
                     interspersed += MANGO_PLACEHOLDER + '\n'
                     updates.append(update)
+                    continue;
                 else:
-                    interspersed += section
                     logger.warning(
-                      'Failed to correctly render update block - malformed or insufficient metadata: %s'
+                      'Section looking like an update failed to render, may be due to '
+                      'insufficient/incorrect metadata or an excerpt starting with '
+                      'the word "Update". Section=%s'
                       %section)
-                continue;
 
             if section:
                 interspersed += section

tests/__init__.py

         
         * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
         
-        ### Update: 20 August 2011 @ 1:30pm
+        ### Update for compatibility for OS X 10.7
         
         I was confused as to the definition of idempotent. It would
         be more accurate to describe the transaction as reversible.
         
         More text.
         ''')
-    def test_insufficient_metadata(self, document):
+    def test_excerpts_starting_with_update(self, document):
         self.assertEqual(
         document.html,
         u'<p>Text.</p>\n'
-        u'<h3>Update: 20 August 2011 @ 1:30pm</h3>\n'
+        u'<h3>Update for compatibility for OS X 10.7</h3>\n'
         u'<p>I was confused as to the definition of idempotent. It would\n'
            u'be more accurate to describe the transaction as reversible.</p>\n'
         u'<p>More text.</p>'
         )
         self.assertEqual(
-        document.excerpt(), document.html
+        document.excerpt(),
+        u'<h3>Update for compatibility for OS X 10.7</h3>\n'
+        u'<p>I was confused as to the definition of idempotent. It would\n'
+        u'be more accurate to describe the transaction as reversible.</p>'
         )
 
     @md('''
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.