Home > front end >  Unkown string showing up on rendered HTML page
Unkown string showing up on rendered HTML page

Time:02-10

A random string "b b b b b" gets inserted between two HTML components which doesn't exist in my code to begin with. I currently have a js script to find this garbage string and just remove it manually. Was wondering if anyone knew why this was happening so I could actually fix it instead of this workaround

This is how the relevant part of the code looks on my local machine (look at the start of the table tag) -

<div >
          <div ></div>
          <div >
              <div >
                  <table >
                    <thead>
                      <tr>
                        <th></th>
                      </tr>
                    </thead>
                    <tbody>
                      <tr>
                        <td>1. {{form.question_1.label_tag}}</td>
                        {% for choice in form.question_1 %}
                        <td><span >{{ choice.tag }}</span></td>
                        {% endfor %}
                      </tr>

                    </tbody>
                  </table>
              </div>
          </div>
          <div ></div>
        </div>

This is how the rendered HTML Code looks. I copied this from the browser inspect element (Notice how the random b \n b \n b\n is inserted right before the table tag without it being in the code)-

<div >
                  b
                        
                        b
                        
                        b
                        
                        b
                        
                        b
                        
                        b
                        
                      <table >

                    <thead>
                      <tr>
                        <th></th>
                      </tr>
                    </thead>

                    <tbody>
                      <tr>
                        <td>1. <label>When this student is feeling happy, they can control their happiness.</label></td>                  
                      </tr>
                      
                    </tbody>
                  </table>

              </div>

This is a Python-Django project being run on Chrome. I tested the same with firefox and this string shows up there too. So, I doubt it's a browser issue.

Any help would be appreciated! Thanks :)

CodePudding user response:

  •  Tags:  
  • Related