From 73f5d37ce26f319e7672d4f565c239c67e13ef55 Mon Sep 17 00:00:00 2001 From: Kenneth Shaw Date: Sat, 30 Sep 2017 08:50:12 +0700 Subject: [PATCH] Fixing bad comment on StreamHandle type in IO domain --- cdp/io/types.go | 2 +- cmd/chromedp-gen/templates/util.go | 7 +++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/cdp/io/types.go b/cdp/io/types.go index 86b1957..f4934a6 100644 --- a/cdp/io/types.go +++ b/cdp/io/types.go @@ -3,7 +3,7 @@ package io // Code generated by chromedp-gen. DO NOT EDIT. // StreamHandle this is either obtained from another method or specified as -// blob:<uuid> where <uuid> is an UUID of a Blob. +// blob: where is an UUID of a Blob. type StreamHandle string // String returns the StreamHandle as string value. diff --git a/cmd/chromedp-gen/templates/util.go b/cmd/chromedp-gen/templates/util.go index f0fb4be..d3bc324 100644 --- a/cmd/chromedp-gen/templates/util.go +++ b/cmd/chromedp-gen/templates/util.go @@ -25,10 +25,17 @@ var keep = map[string]bool{ "JavaScript": true, } +var badHTMLReplacer = strings.NewReplacer( + "<", "<", + ">", ">", + ">", ">", +) + // formatComment formats a comment. func formatComment(s, chop, newstr string) string { s = strings.TrimPrefix(s, chop) s = strings.TrimSpace(internal.CodeRE.ReplaceAllString(s, "")) + s = badHTMLReplacer.Replace(s) l := len(s) if newstr != "" && l > 0 {