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

Issue 10810047: Extensions Docs Server: HTML parser in IDS (Closed)

Created:
8 years, 5 months ago by cduvall
Modified:
8 years, 5 months ago
CC:
chromium-reviews, Aaron Boodman, mihaip-chromium-reviews_chromium.org, chebert, clintstaley
Visibility:
Public.

Description

Extensions Docs Server: HTML parser in IDS Replaced the regex in IntroDataSource with an HTML parser. BUG=131095 Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=148014

Patch Set 1 : #

Total comments: 12

Patch Set 2 : #

Total comments: 4

Patch Set 3 : No HTML in toc and only take first h1 #

Unified diffs Side-by-side diffs Delta from patch set Stats (+58 lines, -17 lines) Patch
M chrome/common/extensions/docs/server2/intro_data_source.py View 1 2 2 chunks +56 lines, -15 lines 0 comments Download
M chrome/common/extensions/docs/server2/templates/private/table_of_contents.html View 1 1 chunk +2 lines, -2 lines 0 comments Download

Messages

Total messages: 5 (0 generated)
cduvall
s/regex/html parser
8 years, 5 months ago (2012-07-20 23:26:39 UTC) #1
not at google - send to devlin
http://codereview.chromium.org/10810047/diff/3001/chrome/common/extensions/docs/server2/intro_data_source.py File chrome/common/extensions/docs/server2/intro_data_source.py (right): http://codereview.chromium.org/10810047/diff/3001/chrome/common/extensions/docs/server2/intro_data_source.py#newcode18 chrome/common/extensions/docs/server2/intro_data_source.py:18: """ I think the pattern is like def __init_(self): ...
8 years, 5 months ago (2012-07-23 12:47:36 UTC) #2
cduvall
https://chromiumcodereview.appspot.com/10810047/diff/3001/chrome/common/extensions/docs/server2/intro_data_source.py File chrome/common/extensions/docs/server2/intro_data_source.py (right): https://chromiumcodereview.appspot.com/10810047/diff/3001/chrome/common/extensions/docs/server2/intro_data_source.py#newcode18 chrome/common/extensions/docs/server2/intro_data_source.py:18: """ On 2012/07/23 12:47:36, kalman wrote: > I think ...
8 years, 5 months ago (2012-07-23 20:24:21 UTC) #3
not at google - send to devlin
lgtm https://chromiumcodereview.appspot.com/10810047/diff/3001/chrome/common/extensions/docs/server2/intro_data_source.py File chrome/common/extensions/docs/server2/intro_data_source.py (right): https://chromiumcodereview.appspot.com/10810047/diff/3001/chrome/common/extensions/docs/server2/intro_data_source.py#newcode43 chrome/common/extensions/docs/server2/intro_data_source.py:43: self._current['title'] = data On 2012/07/23 20:24:21, cduvall wrote: ...
8 years, 5 months ago (2012-07-23 23:30:41 UTC) #4
cduvall
8 years, 5 months ago (2012-07-23 23:58:33 UTC) #5
https://chromiumcodereview.appspot.com/10810047/diff/3001/chrome/common/exten...
File chrome/common/extensions/docs/server2/intro_data_source.py (right):

https://chromiumcodereview.appspot.com/10810047/diff/3001/chrome/common/exten...
chrome/common/extensions/docs/server2/intro_data_source.py:43:
self._current['title'] = data
On 2012/07/23 23:30:41, kalman wrote:
> On 2012/07/23 20:24:21, cduvall wrote:
> > On 2012/07/23 12:47:36, kalman wrote:
> > > Note that this won't handle cases like
> > > 
> > > <h2>This heading is <b>extra important</b></h2>
> > > 
> > > You might need to maintain a "header_tag_stack" and rather than accessing
> > > recent_tag, access the top of that.
> > 
> > I ended up not using a stack, but the new version handles tags in the
> headings.
> > It doesn't handle headings inside of headings, but that should never happen.
I
> > can change it to use a stack instead if you would like.
> 
> sgtm. I realise I started micro-managing you a bit recently, will try to stop
:)

Np, I would much rather learn to do it the right way :)

https://chromiumcodereview.appspot.com/10810047/diff/3002/chrome/common/exten...
File chrome/common/extensions/docs/server2/intro_data_source.py (right):

https://chromiumcodereview.appspot.com/10810047/diff/3002/chrome/common/exten...
chrome/common/extensions/docs/server2/intro_data_source.py:42:
self.handle_data('<' + tag + '/>')
On 2012/07/23 23:30:42, kalman wrote:
> I think we should just strip out the tags, like, if the title was
> 
> <h1>this is <b>very</b> important</h1>
> 
> then we'd want the title to be <title>this is very important</title> --
putting
> HTML in there would look quite strange.
> 
> OTOH having html in the TOC would be nice, just, simpler if we forget about
it.

Done.

https://chromiumcodereview.appspot.com/10810047/diff/3002/chrome/common/exten...
chrome/common/extensions/docs/server2/intro_data_source.py:51: self.page_title
+= data
On 2012/07/23 23:30:42, kalman wrote:
> so if there are multiple <h1> tags it concats them together? I think that
would
> end up looking strange; just use the first one.

Done.

Powered by Google App Engine
This is Rietveld 408576698