Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > Sigil

Notices

Reply
 
Thread Tools Search this Thread
Old Today, 04:08 PM   #16
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: 27,909
Karma: 198500000
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
Quote:
Originally Posted by BeckyEbook View Post
2. Possible real detect missing quotes.
In sanitycheck.py after line 185:
Code:
                    ...
                    val = s[b:p]
                    error_msg = 'Attribute "' + aname + '" has missing quotes surrounding the value'
                    self.errors.append((self.tag_start[0], self.tag_start[1], error_msg))
                    self.has_error = True
                    return None, None, None
                tattr[aname] = val
                ...
I feel that this is sufficient to catch missing quotes, as the previous conditions catch other cases.
Of course, this is worth checking. Fortunately, the sanitycheck.py file is available for editing directly (C:\Program Files\SigilBE\python3lib\sanitycheck.py), so the tests don't require rebuilding Sigil, just restarting it.

Of course, it's better to test it; I've only done about a dozen trials.
You mean line 185 after my proposed PR changes, right? If so, I agree.
DiapDealer is offline   Reply With Quote
Old Today, 04:11 PM   #17
BeckyEbook
Guru
BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.
 
BeckyEbook's Avatar
 
Posts: 771
Karma: 2297170
Join Date: Jan 2017
Location: Poland
Device: Various
Of course, after your last PR.
BeckyEbook is offline   Reply With Quote
Old Today, 04:45 PM   #18
philja
Groupie
philja began at the beginning.
 
Posts: 158
Karma: 10
Join Date: Nov 2015
Location: Europe EEC
Device: Kindle Fire HD6
Quote:
Originally Posted by DiapDealer View Post
Not that hard to believe. **shrug**

It's not the first time that one error will move the goalpost to a different error in a validation routine. And it won't be the last. Not one of them are perfect in detecting all the various ways a user can mess code up.
I didn't make that part as clear as I thought. The epub file I was using for these checks has been clean on Epubcheck for years until I tried interfering with the quotes. Each type of interference I tried, and I only tried a single instance at any one time, caused Epubcheck to flag a load of "Fragment identifier not defined" errors in multiple chapters.

The fragments I looked at were all footnote links in the text body linking to a reference at the end of the chapter. Only one footnote/chapter. The footnote had a return link to the text. These fragments had all worked fine for years and had never been flagged as undefined by Epubcheck over multiple checks.

As soon as the quotes error was corrected, the next Epubcheck was completely clean with no reference to any fragments in any chapter.

I haven't understood the possible connections between a single missing or mismatched quote and unidentified fragments elsewhere. It seems a most unlikely scenario.
philja is offline   Reply With Quote
Old Today, 05:32 PM   #19
BeckyEbook
Guru
BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.
 
BeckyEbook's Avatar
 
Posts: 771
Karma: 2297170
Join Date: Jan 2017
Location: Poland
Device: Various
The connection is simple.
Parsing encounters erroneous incompatible quotes, which results in the inability to check the rest of the text where the footnote text is located, hence the message about the unidentified fragments.

Incompatible quotes are dangerous and I don't understand where they would come from in Sigil, which takes great care to ensure that the code is well-formed. You simply have to be careful when editing your code to avoid such situations.

Here is another example of a file that, when you run the "Mend" option, causes the contents to be cleared.

Code:
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
  "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
  <title>Test</title>
</head>
<body>
<div class='badclass">
  <h1>Chapter</h1>
  <p class="first">Blah</p>
  <p>Blah<a id="fn1" href="#fntext">[1]</a></p>
  <div class="footnotes">
    <div class="footnote">
      <p><a id="fntext" href="#fn1">[1]</a> Footnote 1</p>
    </div>
  </div>
  </div>
</body>
</html>
BeckyEbook is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Sigil Font use without error messages qkiazd Sigil 16 11-18-2023 11:04 AM
Copying error messages AlanHK Sigil 1 09-27-2017 02:07 PM
About translation and error messages hermida Development 12 05-05-2016 04:34 PM
What's with the DRM error messages? AndyElk Calibre 3 02-28-2016 08:14 PM
error messages on new PC huskerruth Devices 1 02-16-2011 11:56 AM


All times are GMT -4. The time now is 10:19 PM.


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