Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2303)

Unified Diff: chrome/common/extensions/docs/server2/intro_data_source.py

Issue 10832042: Extensions Docs Server: Doc conversion script (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: everything but svn stuff Created 8 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/common/extensions/docs/server2/intro_data_source.py
diff --git a/chrome/common/extensions/docs/server2/intro_data_source.py b/chrome/common/extensions/docs/server2/intro_data_source.py
index 83d8a2f49afa5f7ca318f2099a5c77bbdbcf525e..a87298bc313cd8e664c6b3afc930243728d7beeb 100644
--- a/chrome/common/extensions/docs/server2/intro_data_source.py
+++ b/chrome/common/extensions/docs/server2/intro_data_source.py
@@ -2,9 +2,8 @@
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
-import logging
-
from HTMLParser import HTMLParser
+import re
from docs_server_utils import FormatKey
from third_party.handlebar import Handlebar
@@ -62,6 +61,10 @@ class IntroDataSource(object):
def _MakeIntroDict(self, intro):
parser = _IntroParser()
parser.feed(intro)
+ intro = re.sub(re.compile('<h1[^>.]*?>.*?</h1>', flags=re.DOTALL),
cduvall 2012/08/02 00:54:06 Used re here because there's not an easy way to re
+ '',
+ intro,
+ count=1)
return {
'intro': Handlebar(intro),
'toc': parser.toc,

Powered by Google App Engine
This is Rietveld 408576698