Chromium Code Reviews| Index: chrome/common/extensions/docs/server2/intro_data_source.py |
| =================================================================== |
| --- chrome/common/extensions/docs/server2/intro_data_source.py (revision 150187) |
| +++ chrome/common/extensions/docs/server2/intro_data_source.py (working copy) |
| @@ -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 @@ |
| def _MakeIntroDict(self, intro): |
| parser = _IntroParser() |
| parser.feed(intro) |
| + intro = re.sub(re.compile('<h1[^>.]*?>.*?</h1>', flags=re.DOTALL), |
|
not at google - send to devlin
2012/08/07 02:42:14
could cache this compiled regex in file-scope
cduvall
2012/08/07 20:21:38
Done.
|
| + '', |
| + intro, |
| + count=1) |
| return { |
| 'intro': Handlebar(intro), |
| 'toc': parser.toc, |