Skip to content

Commit

Permalink
parser/gdoc: dont't overwrite non-empty title
Browse files Browse the repository at this point in the history
  • Loading branch information
x1ddos committed May 10, 2016
1 parent 4fbb4b1 commit 3f1f485
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion claat/parser/gdoc/parse.go
Original file line number Diff line number Diff line change
Expand Up @@ -206,12 +206,16 @@ func parseDoc(doc *html.Node) (*types.Codelab, error) {
}
switch {
case hasClass(ds.cur, "title") && ds.step == nil:
ds.clab.Title = stringifyNode(ds.cur, true)
if v := stringifyNode(ds.cur, true); v != "" {
ds.clab.Title = v
}
if ds.clab.ID == "" {
ds.clab.ID = slug(ds.clab.Title)
}
continue
case ds.cur.DataAtom == atom.Table && ds.step == nil:
metaTable(ds)
continue
case ds.cur.DataAtom == atom.H1:
newStep(ds)
continue
Expand Down

0 comments on commit 3f1f485

Please sign in to comment.