webuilder Indent HTML Tags also cleans style (unwanted)

Post your questions and problem reports here

Moderator: kfury77

Forum rules
Please try to follow these guidelines. This will help to receive faster and more accurate response.
  • Check the Support section of the corresponding product first. Chances are you will find your answer there;
  • Do not create new topics for already reported problems. Add your comments to the existing topics instead;
  • Create separate topic for each problem request. Do NOT post a number of non-related problem reports in a single topic;
  • Give your topic a meaningful title. Titles such as "A question," "Bug report" and "Help!" provide others no clue what your message is about;
  • Include the version number of the software you are using;
  • This is not an official customer support helpdesk. If you need a prompt and official response, please contact our support team directly instead. It may take a while until you receive a reply in the forum;
Post Reply
johnmcglaughlin
Posts: 20
Joined: Mon Aug 25, 2008 6:19 am

webuilder Indent HTML Tags also cleans style (unwanted)

Post by johnmcglaughlin »

When pulling HTML code from template, I wanted to re indent HTML tags to standard spacing.
The pull down menu feature for this should be exclusive to indent feature requested, tidy of html tags should not be performed.

The result is
Indenting code with the addition of unwanted <![CDATA style

This of course interferes with the site style sheets.
User avatar
mapleleaf
Posts: 121
Joined: Thu Oct 14, 2010 2:21 am
Location: Ashcroft, BC Canada
Contact:

Re: webuilder Indent HTML Tags also cleans style (unwanted)

Post by mapleleaf »

johnmcglaughlin wrote:When pulling HTML code from template, I wanted to re indent HTML tags to standard spacing.
The pull down menu feature for this should be exclusive to indent feature requested, tidy of html tags should not be performed.

The result is
Indenting code with the addition of unwanted <![CDATA style

This of course interferes with the site style sheets.
Would it be possible to show an example of code; the before and the after?

I need some more info before I can effectively respond.

mapleleaf

http://www.mirana.net
johnmcglaughlin
Posts: 20
Joined: Mon Aug 25, 2008 6:19 am

Re: webuilder Indent HTML Tags also cleans style (unwanted)

Post by johnmcglaughlin »

This might be difficult to get the time to do so
I will try

The process was converting html from one web page to a new php content template.

Code: Select all

<?php
?>

          <div class="title">
            <h2 id="title2" class="text3">Header</h2>
          </div>
          <div class="content">
            <p>
              Content
            </p>
          </div>
The old HTML code block gets placed into Content <div></div>, of course this code is rambling on and on and is not presented well. So I used the Indent HTML tags feature.

IMO the problem is that HTML Tidy is being run with the indent. This is not convenient when working with code snipits since header body and html tags are added to the code snipit. Since all other tidy functions perform indent, the indent HTML Tags feature should ONLY indent HTML tags.

I will try to recreate a sample code, but the above statements are the main thrust of my feature change request. Simply that Indent HTML Tags can be counter productive, and inject errors into code.
User avatar
mapleleaf
Posts: 121
Joined: Thu Oct 14, 2010 2:21 am
Location: Ashcroft, BC Canada
Contact:

Re: webuilder Indent HTML Tags also cleans style (unwanted)

Post by mapleleaf »

johnmcglaughlin wrote:This might be difficult to get the time to do so
I will try

The process was converting html from one web page to a new php content template.

Code: Select all

<?php
?>
         
I will try to recreate a sample code, but the above statements are the main thrust of my feature change request.  Simply that Indent HTML Tags can be counter productive, and inject errors into code.[/quote]

Ok, first of all Tidy is not a Bulmental's program it is an external add-on as far as I understand it.

I have used tidy before I knew of WB and as it within WB, you must configure it yourself.
I have never used Tidy for php; always used it for xhtml(1.0 /1.1) in the past.

Why not just do it manually rather than relying on a add-on or software?

You could in your case, remove the php, configure Tidy, run Tidy and then re-add your php.
I am weak in php and rarely used it in the past and now I am in great need for php-MySQL..one never stops learning, right?

Before I got wind of WB 2010, I had always used notepad or notepad++ to write my code and not using a canned software thus I have a far better control of the code and it is much tighter.

WB isnt much different in that sense as it offers a multitude of feature that one when using notepad etc has to do manually.  I truly wished that I had gotten wind of WB some years before.

Now, I wish it had html5 support as I had spend this past weekend doing some troubleshooting only to find out that I had an extra closing tag here and there that were the culprits.

Do you validate to code? Are you using FF for development?  IF you are using FF then there is a great add-on that anyone who develops web site should add namely, Web Developer.  I use FF as my primary source for testign then go through the other six browsers to test.

[quote]

HTML Tidy can perform many different tasks. Each task must be created and configured, before it can be executed. To save your time, WeBuilder comes with a set of pre-configured HTML Tidy tasks.

To execute one of the HTML Tidy tasks, on the Tools menu point to HTML Tidy submenu and click on the name of the task.

When HTML Tidy checks your document, items such as "errors" and "warnings" generated by HTML Tidy are displayed in the Messages panel. You can quickly navigate to the problem area by double-clicking error or warning item.

To configure HTML Tidy tasks, on the Tools menu point to HTML Tidy submenu and click Manage Tasks.

[/quote]

not sure if this is any comfort to you but it gave me a chance to rabble on  :lol: 

mapleleaf
User avatar
MikeyB
Top Contributor
Posts: 511
Joined: Fri Jun 09, 2006 10:38 am
Location: UK
Contact:

Re: webuilder Indent HTML Tags also cleans style (unwanted)

Post by MikeyB »

mapleleaf wrote: Ok, first of all Tidy is not a Bulmental's program it is an external add-on as far as I understand it.
Indeed, HTML Tidy is not a Blumental's product, it's just linked to from within WeBuilder.
http://tidy.sourceforge.net/

I've not used it much as there are far too many options, and have never quite got the result I was hoping for.
But you can change all the options from within WeBuilder Tools -> HTML Tidy -> Configure Tidy and create a new or edit an existing one and you'll see just how many options there are.
johnmcglaughlin
Posts: 20
Joined: Mon Aug 25, 2008 6:19 am

Re: webuilder Indent HTML Tags also cleans style (unwanted)

Post by johnmcglaughlin »

Thank you for the info on Tidy

I will check into it perhaps it can be turned off when doing a simple code indent.

NOTE PHP, Ruby etc. or any other inserted language has no adverse affect on Tidy validation or indentation.

I think that the thread has inadvertently been diverted in a wrong direction. First, I am a 4 year user of Webuilder, and have been using the "Indent HTML Tags" feature from the beginning. Usually I can deal with the added header and body tags and just delete them. That is not a BIG problem.

The issue is with the sub function of the Tidy utility, "Indent HTML Tags", in which the intended feature is TO INDENT THE CODE. Since there is also a "Validate and Fix" sub function to the Tidy utility on can deduce that there there is likely a call problem in the Webuilder code, specifically the call to "Indent HTML Tags" function is possibly calling the "Validate and Fix" feature.

So, I believe the matter still needs to be looked into by Blumentals engineering to see if this is indeed a bad function call from within the Blumentals product, more a complex typo that was easily overlooked during code review.

I have looked into the configuration of Tidy and it seems that these features may be pre configured by Blumentals, as you both indicated. My first attempt at disabling attributes has failed. I will need to look into tidy documentation.

HOWEVER, this would indicate that Blumentals should change the default configuration of "Indent HTML Tags" once a correct combination is found. I would hope someone knows the combination as I don't have the cycles to do this, I will post here if I do find them. Probably on a new thread. I was able to disable the style changes which is the main complaint

Thanks to you both for pointing me to a partial workaround.

THE UNFORTUNATE ANSWER IS
NO.

Tidy first builds a clean tree of the XHMTL then parses it to produce the indent, since the tree is created and fixed first there is no way to not correct the code. c-data can be turned off as I indicated. SO the partial workaround is the only workaround. I can live with the deletion of header and body tags now that I dont have to worry about my css being changed.
Post Reply