Search code examples
javascripthtmlcssperltemplate-toolkit

<br><br><br> getting generated and showing only in Inspect Element


I am using perl with template toolkit to generate Web page and I changed some JS code on HTML file, After Editing there are <br><br><br> showed on UI and I have no Idea How and strange thing is that there is no <br><br><br> in source code, Only on Inspect element One can see <br><br><br>.

Inspect Element:

<form name="data" action="a.pl" method="post" onsubmit="return checkage();">
<br><br><br>
<table width="100%" cellspacing="0" cellpadding="0" border="0">

Source Code:

<form name="data" action="a.pl" method="post" onsubmit="return checkage();">
<table width="100%" cellspacing="0" cellpadding="0" border="0">

Solution

  • My best guess is that your editor has inserted the newlines. These are being translated to HTML line breaks. The newlines are not reflected in what you see because the actual codes representing a newline vary across operating systems

    On Unix platforms, the native newline sequence is ASCII LF, and '\n' was simply defined to be that value.

    On Microsoft Windows, applications usually represent a newline with two control characters: CR+LF