View Single Post
Old 05-11-2013, 04:40 PM   #4
theducks
Well trained by Cats
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: 31,106
Karma: 60406498
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
Quote:
Originally Posted by phossler View Post
Does <blockquote> need <p> tags? I've seen the <p>-less constructs many times cleaning up PD books, so it seems to be a common thing.

This displays OK in Sigil, but the <p>-less <blockquote> generates a "no character data is allowed by content model". I usually try to eliminate as many errors as possible even if they don't matter, just to avoid missing an important one.

Code:
<body>
  <p>This is OK text with p tags</p>

  <blockquote>
    This is block quoted and there are no p tags This is block quoted and there are no p tags This is block quoted and there are no p tags This is block quoted and there are no p tags This is block quoted and there are no p tags This is block quoted and there are no p tags This is block quoted and there are no p tags
  </blockquote>

  <blockquote>
    <p>This is block quoted and there are p tags This is block quoted and there are p tags This is block quoted and there are p tags This is block quoted and there are p tags This is block quoted and there are p tags This is block quoted and there are p tags This is block quoted and there are p tags This is block quoted and there are p tags</p>
  </blockquote>

  <p>This is OK text also with p tags</p>
</body>
I did try some variations of a RegEx, but no luck (this is also a learning area for me)

F: (<blockquote>)!(<p>)(.*)!(</p>)(</blockquote>)
R: <blockquote><p>\3</p><blockquote>

Making sure that there's a question,

1. Are <p> required?
2. What would be the correct RegEx to use so as to avoid the error messages?

Paul
UPDATED to fix possible wrap issue

My 'Naked' BQ w/Calibre class)

Code:
Find= (?m)<blockquote class="calibre(\d+)">\s+([[:alnum:]].+?[[:alnum:]])\s+</blockquote>
Replace= <blockquote class="calibre\1"><div>\2</div></blockquote>

Last edited by theducks; 05-11-2013 at 05:06 PM. Reason: Updated
theducks is offline   Reply With Quote