present: fix newline parsing for go present

Pressing enter on editable go present code adds a new 'pre' html tag
which isn't being handled properly. This fix in play.js adds a newline
to the html is being parsed whenever it sees a 'pre' tag.

Fixes golang/go#41139

Change-Id: I042d13999f4a8518fb282c4c5bfb3a5197215449
Reviewed-on: https://go-review.googlesource.com/c/tools/+/251697
Run-TryBot: Dmitri Shuralyov <dmitshur@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
This commit is contained in:
Muhammad Hamza Farrukh 2020-08-30 17:00:24 -04:00 committed by Dmitri Shuralyov
parent 2364a5e8fd
commit 76a6aac657
2 changed files with 2 additions and 2 deletions

View File

@ -12,7 +12,7 @@ function initPlayground(transport) {
if (n.nodeType === 1) {
if (n.tagName === 'BUTTON') continue;
if (n.tagName === 'SPAN' && n.className === 'number') continue;
if (n.tagName === 'DIV' || n.tagName == 'BR') {
if (n.tagName === 'DIV' || n.tagName === 'BR' || n.tagName === 'PRE') {
s += '\n';
}
s += text(n);

File diff suppressed because one or more lines are too long