Register Guidelines E-Books Search Today's Posts Mark Forums Read

Go Back   MobileRead Forums > E-Book Software > Sigil

Notices

Reply
 
Thread Tools Search this Thread
Old 06-08-2012, 01:22 AM   #1
JJ Joseph
Member
JJ Joseph began at the beginning.
 
Posts: 15
Karma: 10
Join Date: Jun 2012
Device: Kindle
Editing code view in Sigil

The editing of an html file in the code view mode is hampered by Sigil trying to be clever. If I try to change all instances of an html tag ("<blockquote>", for example, Sigil will do a Find/Replace on the opening tag no problem. But when I try to edit the remaining closing tag ("</blockquote"> for example, I can't do it. Sigil refuses to do anything because now the opening & closing tags don't match any more.

The only way I can complete the "Find & Replace" is to copy the entire file and move it to Notepad, and then copy the file back to Sigil. This seems much too clumsy for a smart application like Sigil. Is there anyway to do large edits without confounding Sigil like this?
JJ Joseph is offline   Reply With Quote
Old 06-08-2012, 02:15 AM   #2
meme
Sigil developer
meme ought to be getting tired of karma fortunes by now.meme ought to be getting tired of karma fortunes by now.meme ought to be getting tired of karma fortunes by now.meme ought to be getting tired of karma fortunes by now.meme ought to be getting tired of karma fortunes by now.meme ought to be getting tired of karma fortunes by now.meme ought to be getting tired of karma fortunes by now.meme ought to be getting tired of karma fortunes by now.meme ought to be getting tired of karma fortunes by now.meme ought to be getting tired of karma fortunes by now.meme ought to be getting tired of karma fortunes by now.
 
Posts: 1,275
Karma: 1101600
Join Date: Jan 2011
Location: UK
Device: Kindle PW, K4 NT, K3, Kobo Touch
What version are you running? This works ok for me, but of course I'm using the new beta at the moment.

But you can also do this using Regex, for example change all blockquote (with or without classes) to a simple paragraph then this should work:

Code:
Find: (?sU)<blockquote(.*)>(.*)</blockquote>
Replace: <p>\1</p>
meme is offline   Reply With Quote
Old 06-08-2012, 02:52 AM   #3
Toxaris
Wizard
Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.
 
Toxaris's Avatar
 
Posts: 2,861
Karma: 2714881
Join Date: Oct 2009
Location: Heemskerk, NL
Device: PRS-300, PRS-T1
Switch Tidy off, that might do it for you.

However, it is better to use RegEx and do the replace in pairs. Unexpected things can and will happen if you let Tidy fix the HTML for you again.
Toxaris is offline   Reply With Quote
Old 06-08-2012, 03:07 AM   #4
meme
Sigil developer
meme ought to be getting tired of karma fortunes by now.meme ought to be getting tired of karma fortunes by now.meme ought to be getting tired of karma fortunes by now.meme ought to be getting tired of karma fortunes by now.meme ought to be getting tired of karma fortunes by now.meme ought to be getting tired of karma fortunes by now.meme ought to be getting tired of karma fortunes by now.meme ought to be getting tired of karma fortunes by now.meme ought to be getting tired of karma fortunes by now.meme ought to be getting tired of karma fortunes by now.meme ought to be getting tired of karma fortunes by now.
 
Posts: 1,275
Karma: 1101600
Join Date: Jan 2011
Location: UK
Device: Kindle PW, K4 NT, K3, Kobo Touch
Yeah, of course, Tidy. I turn that off immediately these days - make sure you do the same in the beta - although switching to Edit->Clean Source->Pretty Print (and restarting) is my preferred setting now.
meme is offline   Reply With Quote
Old 06-08-2012, 02:13 PM   #5
Serpentine
Evangelist
Serpentine ought to be getting tired of karma fortunes by now.Serpentine ought to be getting tired of karma fortunes by now.Serpentine ought to be getting tired of karma fortunes by now.Serpentine ought to be getting tired of karma fortunes by now.Serpentine ought to be getting tired of karma fortunes by now.Serpentine ought to be getting tired of karma fortunes by now.Serpentine ought to be getting tired of karma fortunes by now.Serpentine ought to be getting tired of karma fortunes by now.Serpentine ought to be getting tired of karma fortunes by now.Serpentine ought to be getting tired of karma fortunes by now.Serpentine ought to be getting tired of karma fortunes by now.
 
Posts: 416
Karma: 1045911
Join Date: Sep 2011
Location: Cape Town, South Africa
Device: Kindle 3
To replace all of a certain tag:
find: <(/)?blockquote>
replace: <\1newtag>

But yeah, disabling tidy is generally a good plan if you wish to hold on to some sanity (at least in the current release)
Serpentine is offline   Reply With Quote
Old 06-08-2012, 02:24 PM   #6
theducks
Grand Sorcerer
theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.
 
theducks's Avatar
 
Posts: 14,230
Karma: 5495470
Join Date: Aug 2009
Location: The (original) Silicon Valley, USA
Device: Galaxy Tab 2, Astak Pocket Pro, K4NT
Meme
I have a program (Agent Newsreader) that allows the user the option to Save and always use the same layout at startup, regardless of the last

used configuration. It would be kool to also save toggle settings like Tidy, Search showing, Validation results showing

1) (factory) default. (also a command line switch to call this to recover from error/HW configuration changes)
2) Last used (saves state when closing)
3) Saved (snapshot) of windows and button states
theducks is online now   Reply With Quote
Old 06-08-2012, 02:38 PM   #7
meme
Sigil developer
meme ought to be getting tired of karma fortunes by now.meme ought to be getting tired of karma fortunes by now.meme ought to be getting tired of karma fortunes by now.meme ought to be getting tired of karma fortunes by now.meme ought to be getting tired of karma fortunes by now.meme ought to be getting tired of karma fortunes by now.meme ought to be getting tired of karma fortunes by now.meme ought to be getting tired of karma fortunes by now.meme ought to be getting tired of karma fortunes by now.meme ought to be getting tired of karma fortunes by now.meme ought to be getting tired of karma fortunes by now.
 
Posts: 1,275
Karma: 1101600
Join Date: Jan 2011
Location: UK
Device: Kindle PW, K4 NT, K3, Kobo Touch
Quote:
Originally Posted by Serpentine View Post
To replace all of a certain tag:
find: <(/)?blockquote>
replace: <\1newtag>
This is much simpler but only works if the original doesn't have classes or other attributes. You could drop the closing > and that might work. But as with every replace you have to make sure it applies to what you're doing
meme is offline   Reply With Quote
Old 06-08-2012, 03:05 PM   #8
DiapDealer
Grand Sorcerer
DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.
 
DiapDealer's Avatar
 
Posts: 8,754
Karma: 39457947
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
find :<(/)?blockquote([^>]*?)>
replace: <\1newtag\2>
DiapDealer is offline   Reply With Quote
Old 06-09-2012, 01:30 AM   #9
JJ Joseph
Member
JJ Joseph began at the beginning.
 
Posts: 15
Karma: 10
Join Date: Jun 2012
Device: Kindle
Thanks

Quote:
Originally Posted by meme View Post
What version are you running?
Version 0.5.3 - it doesn't say if it's a Beta, or what stage of development. I'm not sure if I can exclude Tidy from Sigil. All I know is that I hate working on anything with Tidy hanging over my shoulder. It's OK if I can call it when I need it, but I don't like it popping up unannounced. The same goes for similar "smart" editors like TinyMCE Edit. They're all a total pain in the you-know-what.
JJ Joseph is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Editing an epub with Sigil Artha Calibre 7 07-01-2011 01:57 PM
quotes differences book view & code view cybmole Sigil 13 03-29-2011 01:53 AM
Editing Feedbooks with Sigil castel15 Sigil 5 03-25-2011 09:00 PM
lock book view & code view windows into synch cybmole Sigil 5 01-19-2011 10:30 PM
Possible to have default view as code view? sherman Sigil 5 06-15-2010 01:47 AM


All times are GMT -4. The time now is 11:50 PM.


MobileRead.com is a privately owned, operated and funded community.