From 223443c057e64ca04cda5c0f37f5d15daaf69337 Mon Sep 17 00:00:00 2001 From: Ivan Pazhitnykh Date: Fri, 30 Aug 2019 23:30:36 +0300 Subject: [PATCH] Playground: Fix "Report issue" 414 bug (#6409) --- website/playground/Playground.js | 257 ++++++++++++++++--------------- website/playground/buttons.js | 12 +- 2 files changed, 140 insertions(+), 129 deletions(-) diff --git a/website/playground/Playground.js b/website/playground/Playground.js index c948684f..265ff667 100644 --- a/website/playground/Playground.js +++ b/website/playground/Playground.js @@ -1,6 +1,6 @@ import React from "react"; -import { Button, ClipboardButton, LinkButton } from "./buttons"; +import { Button, ClipboardButton } from "./buttons"; import EditorState from "./EditorState"; import { DebugPanel, InputPanel, OutputPanel } from "./panels"; import PrettierFormat from "./PrettierFormat"; @@ -42,6 +42,10 @@ const ENABLED_OPTIONS = [ "requirePragma", "vueIndentScriptAndStyle" ]; +const ISSUES_URL = "https://github.com/prettier/prettier/issues/new?body="; +const MAX_LENGTH = 8000 - ISSUES_URL.length; // it seems that GitHub limit is 8195 +const COPY_MESSAGE = + "\n"; class Playground extends React.Component { constructor(props) { @@ -135,131 +139,144 @@ class Playground extends React.Component { debugDoc={editorState.showDoc} reformat={editorState.showSecondFormat} > - {({ formatted, debug }) => ( - -
- - - - -