Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Formats > ePub

Notices

Reply
 
Thread Tools Search this Thread
Old 08-21-2019, 03:44 PM   #1
codys
Junior Member
codys began at the beginning.
 
Posts: 6
Karma: 10
Join Date: Oct 2018
Device: Kindle Paperwhite
<Blockquote> problems

I am trying to use blockquote, which seems to be allowed, but I am getting an error around the closing tag.

Example code:

Code:
<?xml version='1.0' encoding='utf-8'?>
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">

<head>
<title>Bacon Addicts Anonymous</title>
<link href="centercut-style.css" rel="stylesheet" type="text/css"/>
</head>

<body>

<h1 class="title">Bacon Addicts Anonymous</h1>

<h2 class="subtitle">Pro/Con: Must all bacon be pork?</h2>

<h3 class="subheading">Pro: Real bacon comes from pigs!</h3>

<p class="primary2">Lorem ipsum dolor sit amet, consectetur adipiscing elit. </p>

<blockquote>Cras ornare massa odio.</blockquote>

</body>

</html>
Then the error:

Quote:
ERROR start.xhtml 19 38 Error while parsing file: text not allowed here; expected element "address", "blockquote", "del", "div", "dl", "h1", "h2", "h3", "h4", "h5", "h6", "hr", "ins", "noscript", "ns:svg", "ol", "p", "pre", "script", "table" or "ul" (with xmlns:ns="http://www.w3.org/2000/svg")

ERROR start.xhtml 19 49 Error while parsing file: element "blockquote" incomplete; expected element "address", "blockquote", "del", "div", "dl", "h1", "h2", "h3", "h4", "h5", "h6", "hr", "ins", "noscript", "ns:svg", "ol", "p", "pre", "script", "table" or "ul" (with xmlns:ns="http://www.w3.org/2000/svg")
Specifically, the first error is between the B and the L of </blockquote> and the second error is after </blockquote>.

I know that there's ways to do what I want without using blockquote, but it bugs me that I can't figure out what's wrong. It seems to have a problem with the closing tag itself. The first error looks like it think it's text outside of a tag, and the second looks like the tag's not even there.

What am I missing here?

--

EDIT: Epub, of course, on Calibre.

Last edited by codys; 08-21-2019 at 03:44 PM. Reason: Details
codys is offline   Reply With Quote
Old 08-21-2019, 04:41 PM   #2
jhowell
Grand Sorcerer
jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.
 
jhowell's Avatar
 
Posts: 6,498
Karma: 84420419
Join Date: Nov 2011
Location: Tampa Bay, Florida
Device: Kindles
You can’t have bare text inside of the blockquote. Use something like:

<blockquote><p>Cras ornare massa odio.</p></blockquote>
jhowell is offline   Reply With Quote
Old 08-22-2019, 03:15 AM   #3
Vroni
Banned
Vroni knows the difference between 'who' and 'whom'Vroni knows the difference between 'who' and 'whom'Vroni knows the difference between 'who' and 'whom'Vroni knows the difference between 'who' and 'whom'Vroni knows the difference between 'who' and 'whom'Vroni knows the difference between 'who' and 'whom'Vroni knows the difference between 'who' and 'whom'Vroni knows the difference between 'who' and 'whom'Vroni knows the difference between 'who' and 'whom'Vroni knows the difference between 'who' and 'whom'Vroni knows the difference between 'who' and 'whom'
 
Posts: 168
Karma: 10010
Join Date: Oct 2018
Device: Tolino/PRS 650/Tablet
Hi,

to be honest i never used blockquote cause it doesnt make sense to me. I prefer divs as a container or adding classes to the paragrafs if needed. Blockquota just adds some indentation/margins/paddings around some other elements an d you never know what the target renderer will do with it.
Vroni is offline   Reply With Quote
Old 08-22-2019, 09:31 AM   #4
codys
Junior Member
codys began at the beginning.
 
Posts: 6
Karma: 10
Join Date: Oct 2018
Device: Kindle Paperwhite
Quote:
Originally Posted by jhowell View Post
You can’t have bare text inside of the blockquote. Use something like:

<blockquote><p>Cras ornare massa odio.</p></blockquote>
It's that simple? I knew it had to be. Thank you!

Quote:
Originally Posted by Vroni
to be honest i never used blockquote cause it doesnt make sense to me. I prefer divs as a container or adding classes to the paragrafs if needed. Blockquota just adds some indentation/margins/paddings around some other elements an d you never know what the target renderer will do with it.
You're right, of course. There are better ways to do it. I'm not sure why I went this way this time. Thank you!
codys is offline   Reply With Quote
Old 08-22-2019, 12:35 PM   #5
Turtle91
A Hairy Wizard
Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.
 
Turtle91's Avatar
 
Posts: 3,095
Karma: 18727053
Join Date: Dec 2012
Location: Charleston, SC today
Device: iPhone 11/X/6/iPad 1,2,Air & Air Pro/Surface Pro/Kindle PW & Fire
It isn't that there are 'better ways'...just different.

The use of <blockquote> is more semantically correct when creating a block quote, whereas a <div> is a simple division, and classed paragraphs are just formatting the paragraph. Yes, you can make them look the same, but using a blockquote when you have a long quote (usually of multiple paragraphs) sets up your document properly.


P.S. You can style blockquotes to look any way you want with CSS and the target renderer will treat it just as well/badly as it would treat any other CSS.

example:
Spoiler:
Code:
blockquote {
              margin:2em; 
              border:2px solid black;
              padding:5px 10px}

blockquote p {
              text-indent:0; 
              margin-bottom:.5em; 
              font-size:.8em}

blockquote p.citation {
              text-align:right;
              margin:2em 0 0}


<blockquote>
<p>I've seen things you people wouldn't believe. 
Attack ships on fire off the shoulder of Orion. I watched 
C-beams glitter in the dark near the Tannhauser gate. 
All those moments will be lost in time… 
like tears in rain… Time to die.</p>
<p class="citation">Replicant Roy Batty,<br/>
<em>Blade Runner (1982)</em></p>
</blockquote>


<blockquote>
<p>I am Connor MacLeod of the Clan MacLeod. 
I was born in 1518 in the village of Glenfinnan on the shores of Loch Shiel.
And I am immortal.</p>
<p class="citation">Connor MacLeod,<br/>
<em>Highlander (1986)</em></p>
</blockquote>

<blockquote>
<p>You take the blue pill — the story ends, you wake up in your bed 
and believe whatever you want to believe.</p>
<p>You take the red pill — you stay in Wonderland and I show you how 
deep the rabbit-hole goes.</p>
<p class="citation">Morpheus,<br/><em>The Matrix (1999)</em></p>
</blockquote>
Attached Thumbnails
Click image for larger version

Name:	Capture.JPG
Views:	236
Size:	57.5 KB
ID:	173082  

Last edited by Turtle91; 08-22-2019 at 01:28 PM.
Turtle91 is online now   Reply With Quote
Old 08-22-2019, 12:55 PM   #6
Vroni
Banned
Vroni knows the difference between 'who' and 'whom'Vroni knows the difference between 'who' and 'whom'Vroni knows the difference between 'who' and 'whom'Vroni knows the difference between 'who' and 'whom'Vroni knows the difference between 'who' and 'whom'Vroni knows the difference between 'who' and 'whom'Vroni knows the difference between 'who' and 'whom'Vroni knows the difference between 'who' and 'whom'Vroni knows the difference between 'who' and 'whom'Vroni knows the difference between 'who' and 'whom'Vroni knows the difference between 'who' and 'whom'
 
Posts: 168
Karma: 10010
Join Date: Oct 2018
Device: Tolino/PRS 650/Tablet
Nonsens deleted
Vroni is offline   Reply With Quote
Old 08-22-2019, 04:14 PM   #7
Tex2002ans
Wizard
Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.
 
Posts: 2,297
Karma: 12126329
Join Date: Jul 2012
Device: Kobo Forma, Nook
Quote:
Originally Posted by jhowell View Post
You can’t have bare text inside of the blockquote. Use something like:

<blockquote><p>Cras ornare massa odio.</p></blockquote>


Quote:
Originally Posted by Vroni View Post
to be honest i never used blockquote cause it doesnt make sense to me. I prefer divs as a container or adding classes to the paragrafs if needed.
As Turtle91 said, there are semantic reasons why you want to use the more specific <blockquote> instead of simple <div>.

Quote:
Originally Posted by Vroni View Post
Blockquota just adds some indentation/margins/paddings around some other elements an d you never know what the target renderer will do with it.
No. It's not "just indentation/margins", there's meaning behind marking it: a longer quote.

It's just like you marking <h1> for headings instead of <div class="heading">... it's not "just bigger bold font".

And if you follow standards, everyone is better off because of higher-level functionality.

Here's a few simple examples I could think of off the top of my head:
  • Anything that overrides CSS, like Firefox's "Reader View", can have proper fallbacks.
    • (I'm LOVING using Reader View on Mobile too, it makes reading those damn "Mobile-Optimized sites" so much better.)
  • Conversion to different formats.
    • Printing might adjust widows/orphans, so a quote doesn't get broken across pages.
  • A Screen Reader can read long quotes with a slightly different tone.
  • Text-to-Speech can add extra pause between blockquotes.
  • Screen Readers can easily navigate the document by "jumping to the next blockquote".

Just like marking <h1-h6>, you can then easily generate TOCs, or have a floating TOC at the side.

Using standard tags allows much more robust handling across all types of use-cases (even many future ones).

Last edited by Tex2002ans; 08-22-2019 at 05:30 PM.
Tex2002ans is offline   Reply With Quote
Old 08-22-2019, 06:48 PM   #8
JSWolf
Resident Curmudgeon
JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.
 
JSWolf's Avatar
 
Posts: 74,015
Karma: 129333114
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
Quote:
Originally Posted by Vroni View Post
Hi,

to be honest i never used blockquote cause it doesnt make sense to me. I prefer divs as a container or adding classes to the paragrafs if needed. Blockquota just adds some indentation/margins/paddings around some other elements an d you never know what the target renderer will do with it.
If the renderer doesn't properly handle a blockquote, then the renderer is garbage and should not be used.
JSWolf is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Blockquote Tab Cyberseeker Sigil 10 05-19-2017 11:26 AM
<blockquote> help, please phossler Sigil 31 06-11-2013 09:28 PM
EPUB to MOBI blockquote problems GOGGS75 Conversion 6 07-22-2012 09:45 AM
blockquote over ride dicknskip Sigil 3 03-21-2011 04:44 PM
FBReader blockquote minigrrl PocketBook 3 03-09-2010 08:09 PM


All times are GMT -4. The time now is 03:37 PM.


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