Skip to content

Commit 76a6aac

Browse files
Hamza141dmitshur
authored andcommitted
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 <[email protected]> TryBot-Result: Gobot Gobot <[email protected]> Reviewed-by: Dmitri Shuralyov <[email protected]>
1 parent 2364a5e commit 76a6aac

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

godoc/static/play.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ function initPlayground(transport) {
1212
if (n.nodeType === 1) {
1313
if (n.tagName === 'BUTTON') continue;
1414
if (n.tagName === 'SPAN' && n.className === 'number') continue;
15-
if (n.tagName === 'DIV' || n.tagName == 'BR') {
15+
if (n.tagName === 'DIV' || n.tagName === 'BR' || n.tagName === 'PRE') {
1616
s += '\n';
1717
}
1818
s += text(n);

0 commit comments

Comments
 (0)