WordPress.org

Forums

Tabs vs Spaces for Indentation in Theme HTML (3 posts)

  1. Raam Dev
    Member
    Posted 1 year ago #

    The WordPress coding standard doc says to use real tabs and not spaces for HTML (and PHP), but when I "view source" for my theme in the browser those tab characters result in really messy HTML (see screenshot: https://cloudup.com/csiKIoOQpCa ).

    Is the only solution to use less indentation in the source code? If those tabs were replaced with spaces, the code, when viewing source, suddenly becomes far more readable (https://cloudup.com/ctifzTM2f8U).

    I understand the reasoning behind keeping a standard, I'm just wondering if anyone else has come up against this problem and what discussion, if any, has been had about it. If someone can point me to existing discussion on this topic, that would be great.

  2. Andrew
    Nuh uh moderator
    Posted 1 year ago #

    I'm not sure the view-source code matters, aren't the standards referring to the actual template files?

  3. Raam Dev
    Member
    Posted 1 year ago #

    I was less concerned with how it looked and more concerned with the performance impact of all that unnecessary whitespace.

Topic Closed

This topic has been closed to new replies.

About this Topic