1

I put the following code into the bock content box and set the input type to Full HTML; then I enabled it on page--front.tpl.php. When I viewed the HTML source, I saw the <a> label contained a <p> tag.

  <ul>
      <li><a href="addons.html"><img class="floatleft" src="images/Panel-index03_108.jpg" /><p><strong>test</strong><br/>
      Fujia Chanpin 01</p></a></li>
       <li><a href="addons.html"><img class="floatleft" src="images/Panel-index03_108.jpg" /><p><strong>test</strong><br/>
      Fujia Chanpin 01</p></a></li>
      <li><a href="addons.html"><img class="floatleft" src="images/Panel-index03_108.jpg" /><p><strong>test</strong><br/>
      Fujia Chanpin 01</p></a></li>
      <li><a href="addons.html"><img class="floatleft" src="images/Panel-index03_108.jpg" /><p><strong>test/strong><br/>
      Fujia Chanpin 01</p></a></li>
      <li><a href="addons.html"><img class="floatleft" src="images/Panel-index03_108.jpg" /><p><strong>test</strong><br/>
      Fujia Chanpin 01</p></a></li>
      <li><a href="addons.html"><img class="floatleft" src="images/Panel-index03_108.jpg" /><p><strong>test</strong><br/>
      Fujia Chanpin 01</p></a></li>
      <li><a href="addons.html"><img class="floatleft" src="images/Panel-index03_108.jpg" /><p><strong>test</strong><br/>
      Fujia Chanpin 01</p></a></li>
    </ul>

For example, for the last list item, the output was the following.

<a href="addons.html"><img src="sites/all/themes/cpanel/images/cPanel-index03_108.jpg" class="floatleft"><p><strong>tsdet</strong><br>Fujia Chanpin 01</p><p></p></a>

Why is there a <p> tag where I didn't add it?

4

For not getting the paragraph tags, you need to use an input format that does not include the Lines and paragraphs break automatically setting.

Check to see if Convert line breaks into HTML input format is enabled in admin/config/content/formats/full_html, and disable it. You can still add <p> and <br>, but Drupal will not add them automatically for every line break present in the text.

  • but my code needs paragraph and break tags.how do i do? – enjoylife May 30 '11 at 11:41
  • 3
    check to see if Convert line breaks into HTML is enabled /admin/config/content/formats/full_html and disable it. You can still use your own p and br, but Drupal will not convert it automatically. – Ek Kosmos May 30 '11 at 11:47

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.