Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Requesting HTML content often renders the requested html in the chat window instead of giving me the HTML code that I can copy #52

Open
funinvegas opened this issue Apr 12, 2023 · 0 comments

Comments

@funinvegas
Copy link

I'm able to work around by asking for the contents of the body tag, but if chatGPT renders a full HTML file it will occasionally render in place instead.

I reproduced by selecting all of my HTML in a file (below) and asking it to add fields.

<html>
  <head>
    <meta charset="UTF-8">
    <title>ChatGPT Prompt</title>
    <link rel="stylesheet" type="text/css" href="style.css">
  </head>
  <body>
    <h1>ChatGPT Prompt</h1>
    <div style="display: flex;">
      <div style="flex: 1; margin-right: 20px;">
        <h3>Column 1</h3>
        <form>
          <label for="prompt1">Enter your prompt:</label><br>
          <textarea id="prompt1" name="prompt1" rows="4" cols="50"></textarea><br><br>
          <button type="button" onclick="generateResponse(1)">Submit</button><br><br>
          <label for="response1">ChatGPT Response:</label><br>
          <textarea id="response1" name="response1" rows="8" cols="50" style="height: 300px;"></textarea>
        </form>
      </div>
      <div style="flex: 1; margin-right: 20px;">
        <h3>Column 2</h3>
        <form>
          <label for="prompt2">Enter your prompt:</label><br>
          <textarea id="prompt2" name="prompt2" rows=\"4" cols="50"></textarea><br><br>
          <button type="button" onclick="generateResponse(2)">Submit</button><br><br>
          <label for="response2">ChatGPT Response:</label><br>
          <textarea id="response2" name="response2" rows="8" cols="50" style="height: 300px;"></textarea>
        </form>
      </div>
      <div style="flex: 1;">
        <h3>Column 3</h3>
        <form>
          <label for="prompt3">Enter your prompt:</label><br>
          <textarea id="prompt3" name="prompt3" rows="4" cols="50"></textarea><br><br>
          <button type="button" onclick="generateResponse(3)">Submit</button><br><br>
          <label for="response3">ChatGPT Response:</label><br>
          <textarea id="response3" name="response3" rows="8" cols="50" style="height: 300px;"></textarea>
        </form>
      </div>
    </div>
    <script>
      async function generateResponse(column) {
        const input = document.getElementById(`prompt${column}`).value;
        const response = await fetch(`/prompt?prompt=${encodeURI(input)}`);
        const result = await response.text();
        document.getElementById(`response${column}`).value = result;
      }
    </script>
  </body>
</html>```

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant