Rushdeep Singh
Rushdeep Singh

Reputation: 21

Double space replaced automatically with single space when using TIDY HTML, and i dont want that to happen

I am using HTML TIDY and I see that if there is double space in my text/HTML to be fixed, Tidy would replace the double space with a single space, and I do not what that to happen, any help would be great???? here is my config for HTML Tidy.

tidy-mark: no
show-errors: 6
show-warnings: yes
output-xml: no
enclose-text: yes
wrap: 0
uppercase-tags: yes
uppercase-attributes: yes
show-body-only: yes
new-inline-tags: replaced,city,place,personname,country-region

Upvotes: 2

Views: 1325

Answers (2)

Raphaël G.
Raphaël G.

Reputation: 19

Use option literal-attributes: yes (by default no) to not replace double space by single space inside attributes (where it should matters).

A typical case where you have something like :

<a href="/somewhere  .htm">click here</a>

And you need to keep the double space for the link to still works.

Upvotes: 0

Jeremiah Willcock
Jeremiah Willcock

Reputation: 30989

In most places in HTML, double spaces are treated as single spaces by the browser. That is likely why HTML Tidy replaces them: they just take space in your HTML file for no benefit. You need non-breaking spaces if you actually want two spaces to appear.

Upvotes: 1

Related Questions