Solved

Tidy - avoid removal of empty elements

Posted on 2010-11-07
1
1,708 Views
Last Modified: 2012-05-10
Hello,

we'd like to avoid removing empty elements with tidy, such as:
<span class="test"></span>

Open in new window


since we need it for several css hacks. We know the option to just include an escaped whitespace:
<span class="test">&nbsp;</span>

Open in new window


but that's not really an option. Also we cannot add name or id attributes, since otherwise any single span element would need a unique name.

Is there a way in the tidy options to configure NOT to remove empty tags?

Thanks and bests
0
Comment
Question by:semantique
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 9

Accepted Solution

by:
pg-expert earned 500 total points
ID: 34081703
what you are using is the best option to avoid tidy removing empty tags.

~PG
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Nothing in an HTTP request can be trusted, including HTTP headers and form data.  A form token is a tool that can be used to guard against request forgeries (CSRF).  This article shows an improved approach to form tokens, making it more difficult to…
Today, the web development industry is booming, and many people consider it to be their vocation. The question you may be asking yourself is – how do I become a web developer?
In this tutorial viewers will learn how to embed an audio file in a webpage using HTML5. Ensure your DOCTYPE declaration is set to HTML5: : The declaration should display (CODE) HTML5 is supported by the most recent versions of all major browsers…
The viewer will learn how to dynamically set the form action using jQuery.

749 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question