4 Replies Latest reply on Feb 11, 2010 6:35 PM by hen3ry

    What is it about this markup that breaks DW CS3 Design View Editing?

    hen3ry Level 1

      Folks:

       

      I'm attaching very simple --and apparently completely valid-- markup that generates the text shown between the markers below:

       

      ------------start----------------

      yadda yadda yadda yadda yadda yadda yadda yadda yadda yadda yadda yadda yadda yadda yadda yadda yadda yadda yadda yadda yadda yadda yadda yadda yadda yadda yadda yadda yadda yadda yadda yadda yadda badda.

      ------------end----------------

       

      As you can see by examining the file, it contains only an span enclosing text and spaces, and some following breaks.  This file passes DW validation: no errors or warnings.

       

      If I open this file in DW CS3 Design View, select and delete the last word, "badda", the entire text --every "yadda"--  is also deleted.  All that text is really gone -- if I immediately save the file and re-open it, there is no text content at all, just the span pair,  spaces, and the trailing breaks.  This is completely repeatable.

       

      When you edit this file, do you get the same result?

       

      The attached file is a cut-down, simplified version of a production file that exhibits this issue. (That file also passes validation.)   When I delete single  words,  entire content paragraphs disappear.   So this is not just a point of curiosity.  I need to figure out how to fix the production code and avoid this problem in the future.

       

      What is it about the attached markup that causes this issue?  I've fooled around with this code quite a bit and the best I can figure out is that DW is confused when both the start- and end- span tags are followed immediately by a line break.  Inserting a space in either place makes the issue go away.   But the production code doesn't have any occurances of this pattern. And, anyway, line-breaks have no significance to html, just for source-code formatting, right?

       

      Am I missing something incredibly obvious?

       

      TIA

       

      hen3ry

        • 1. Re: What is it about this markup that breaks DW CS3 Design View Editing?
          Nancy OShea Adobe Community Professional & MVP

          Your code which follows is not valid HTML markup.

           

          <span>
           yadda yadda yadda yadda yadda yadda yadda yadda yadda yadda yadda yadda yadda yadda yadda yadda yadda yadda yadda yadda yadda yadda yadda yadda yadda yadda yadda yadda yadda yadda yadda yadda yadda badda.<br><br>
          </span>
          

           

          HTML requires a valid document type declaration, <html> <head>, and <body> tags. Also, you have no <p> or <h1> tags around the <span> tags.

           

          What happens when you try it with the following markup?

           

          <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
          <html xmlns="http://www.w3.org/1999/xhtml">
          <head>
          <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
          <title>Untitled Document</title>
          </head>
          <body>
          <p>
          <span>
          yadda yadda yadda yadda yadda yadda yadda yadda yadda yadda yadda yadda yadda yadda yadda yadda yadda yadda yadda yadda yadda yadda yadda yadda yadda yadda yadda yadda yadda yadda yadda yadda yadda badda.
          </span>
          </p>
          </body>
          </html>
          
          

           

           

           

          Nancy O.
          Alt-Web Design & Publishing
          Web | Graphics | Print | Media  Specialists
          www.alt-web.com/
          www.twitter.com/altweb
          www.alt-web.blogspot.com

          • 2. Re: What is it about this markup that breaks DW CS3 Design View Editing?
            hen3ry Level 1

            Nancy O:

             

            Thank you for your response, which gave me  valuable clues to understanding the issues.   (Specifically, it led me to re-read and understand better the nitty-gritty of the HTML4 specs,  section 7, "The global structure of an HTML Document", especially 7.5.1 The BODY element.)

             

            I believe you are saying --in sum--  that to be reliably edited in DW, each source file must comprise a syntactically correct and complete HTML Document.

             

            I am attaching a second file, "badcode2.html", modified substantially as you suggest.  It passes the DW validator, the validator.w3.org test, and the www.totalvalidator.com test.    No errors or warnings.

             

            I do this:   Launch DW, open this file, choose Design View if necessary, select the final word of text, "badda", and activate Edit-->Cut (or Delete).   As before, all the other text is deleted as well. This is repeatable.

             

            It seems to me this sample code satisfies your general principle.  Could I be misapplying the three validation tests?  Or that passing these tests does not assure the document  is syntactically correct and complete?   Can you recommend other tests?

             

            I'd like to add the following two points as a matter of background and a bit of niggling:

             

            --I'm aware  that complete HTML pages must contain <html> , <head>,  and <body> tags, although the HTML4 specification seems to say <body> tags are optional.   All my production pages, as served, contain these tags.   My underlying design is a php template with individual content files incorporated by inclusion.   There may be only one set of <html> , <head>,  and <body> in  a  page. The  "outer" template code provides these tags, and individual content files cannot contain a nested set -- so they must be "bare" markup.   Is DW able to support this design, in which "bare markup" files are seemingly unavoidable?    Is there a mechanism analogous to DW Design-Time Style Sheets to provide virtual existence of these tags so "bare markup" files can be successfully edited?  I've looked for such a mechanism but not found one.    Or some completely different method? 

             

            --You specify the inclusion of <p> or <h1> tags within the  body.    Is there some special significance of <p> or <h1>  with respect to stable editing in DW?  My reading of the HTML4 spec indicates that a single block element is the minimal requirement for body content. Either of these tags qualify, right?   But so does <div>, and that's what I use in my current example.    Am I misunderstanding something?

             

            Bottom line,  I'm looking for a pragmatic solution for my problem:   Once in a while, among hundreds of  structurally similar "bare markup" pages I edit in DW without any problem,  I lose data.   If inserting an additional tag into all my content include files eliminates these occasional problems, I'm  willing to do that, as long as:  (1) There is an arguable technical basis for the addition,  (2) the added tag does not  produce anything visible on the served page, and (3) the validators don't flag the extra tag.   

             

            Suggestions, please!

             

            Thanks,

             

            hen3ry
            • 3. Re: What is it about this markup that breaks DW CS3 Design View Editing?
              Nancy OShea Adobe Community Professional & MVP

              Sorry, I can't recreate your problem.

               

              I use server-side includes all the time (bare bones code). But these fragments may not necessarily validate on their own.  It's what happens to them on the server-side and in context with everything else that matters.  FWIW: I typically edit include files in Code View, not design view.

               

              I don't use span tags much.  But when I do, in keeping with good semantic markup I wrap them inside more descriptive HTML tags. <p>, <h1> <h2> <h3> <ul> <li> etc... 

               

              My guess is that there may be something wacky with your installation.  Have a look at the DW FAQ under UNEXPLAINED PROBLEMS

              http://forums.adobe.com/thread/429114

               

               

              Nancy O.
              Alt-Web Design & Publishing
              Web | Graphics | Print | Media  Specialists
              www.alt-web.com/
              www.twitter.com/altweb
              www.alt-web.blogspot.com

              • 4. Re: What is it about this markup that breaks DW CS3 Design View Editing?
                hen3ry Level 1

                Nancy O:

                 

                Thanks for your response.

                 

                It's best for you that you cannot reproduce my problem on your system -- you don't want my kind of gremlins.

                 

                Keep in mind that this issue comes up only once in a great while for me, and only occurs when I use Design View, so it isn't surprising you can't see it.

                 

                I looked at the FAQ page, thanks.  I don't see anything promising.

                 

                As far as my installation, well... I've been here before, several years ago, with the same problem.

                 

                To the best of my recollection, I never found a specific method of making the problem go away.  I think I just banged away at the failing file and eventually it stopped failing. The problem didn't occur again for many months.    The number of sites and content files I'm authoring and managing has increased significantly since then, so this "solution" is much less attractive.

                 

                A bit of self-analysis:   In web-authoring, I'm totally self-taught on top of, well, a long career of varied software experience.  I've  got a strong tendency towards parsimony ("I can code that with only 3 tags!").    So: My gut feeling is that I'm violating some conceptual assumption(s) of the DW designers. My code gets by the validators, but the way I write the markup is ... unexpected.     Who would do it that way?

                 

                Just now I went back to the file currently causing the problem and fooled with it.  Though structurally it looks exactly like dozens of other source files I've maintained with no problem, and it passes DW's validation,  editing it is a mess.  Deleting _here_ causes a chunk of text _there_ to disappear.   After several of these, there's a chunk of text that won't select at all.  Clearly DW's internal model of the content is scrambled.

                 

                What to do?   Hmmm, let's try a trick from my experience with complex algebraic equations:  "When in doubt, use more parentheses. "  Yep, adding <div> .... </div> around the central content seems to have stabilized the file.

                 

                From now forward, I'm going to try this rule:  " When in doubt --or in trouble-- use more divs."    How does that sound?     Over time, I guess I'll need to retrofit all those files that don't have any problems, just to be safe.

                 

                Thanks!

                 

                hen3ry