View Single Post
Old 07-07-2010, 11:34 AM   #3
Valloric
Created Sigil, FlightCrew
Valloric ought to be getting tired of karma fortunes by now.Valloric ought to be getting tired of karma fortunes by now.Valloric ought to be getting tired of karma fortunes by now.Valloric ought to be getting tired of karma fortunes by now.Valloric ought to be getting tired of karma fortunes by now.Valloric ought to be getting tired of karma fortunes by now.Valloric ought to be getting tired of karma fortunes by now.Valloric ought to be getting tired of karma fortunes by now.Valloric ought to be getting tired of karma fortunes by now.Valloric ought to be getting tired of karma fortunes by now.Valloric ought to be getting tired of karma fortunes by now.
 
Valloric's Avatar
 
Posts: 1,982
Karma: 350515
Join Date: Feb 2008
Device: Kobo Clara HD
Quote:
Originally Posted by troymc View Post
But what happens to background, non-viewed pages which contain the error (it was a global s&r)? They are never opened, and so never rendered. Are they somehow run thru Tidy and "fixed"?
Yes. All the chapters that have been opened are stored as a DOM (parsed XML) in memory. To do that, the XML needs to be valid.

So when a global search&replace operation screws up the mark-up, Tidy runs to try and fix it. It usually does a good job of this. But if you really screwed up the code, well then... bad things happen.

Quote:
Originally Posted by troymc View Post
I made a typo in a search/replace of a style parameter and now 85 chapters of verse have been reduced to this:
Code:
<body>
  <p>/* 
<![CDATA[*/
  
  /*]]>
 */</p>
</body>
That's got to hurt.

Quote:
Originally Posted by troymc View Post
I know, I know. It's not enough to save to disk. I should be making backups or using source control.

3 weeks of editing gone - I have a headache.
I feel for you, I really do. I plan to add an autosave feature that would save your document to three rotating backups every five minutes or so. You could then always open one of those.
Valloric is offline   Reply With Quote