Login
[x]
Log in using an account from:
Fedora Account System
Red Hat Associate
Red Hat Customer
Or login using a Red Hat Bugzilla account
Forgot Password
Login:
Hide Forgot
Create an Account
Red Hat Bugzilla – Attachment 576293 Details for
Bug 772362
Review Request: sigil - Free, Open Source WYSIWYG ebook editor
[?]
New
Simple Search
Advanced Search
My Links
Browse
Requests
Reports
Current State
Search
Tabular reports
Graphical reports
Duplicates
Other Reports
User Changes
Plotly Reports
Bug Status
Bug Severity
Non-Defaults
|
Product Dashboard
Help
Page Help!
Bug Writing Guidelines
What's new
Browser Support Policy
5.0.4.rh83 Release notes
FAQ
Guides index
User guide
Web Services
Contact
Legal
This site requires JavaScript to be enabled to function correctly, please enable it.
diff between sigil and upstream libtidy
libtidy-sigil.diff (text/plain), 16.08 KB, created by
Dan Horák
on 2012-04-09 19:47:51 UTC
(
hide
)
Description:
diff between sigil and upstream libtidy
Filename:
MIME Type:
Creator:
Dan Horák
Created:
2012-04-09 19:47:51 UTC
Size:
16.08 KB
patch
obsolete
>Index: include/tidyenum.h >=================================================================== >RCS file: /cvsroot/tidy/tidy/include/tidyenum.h,v >retrieving revision 1.18 >diff -u -r1.18 tidyenum.h >--- include/tidyenum.h 18 Jun 2008 20:18:54 -0000 1.18 >+++ include/tidyenum.h 9 Apr 2012 19:43:25 -0000 >@@ -204,6 +204,7 @@ > TidySortAttributes, /**< Sort attributes */ > TidyMergeSpans, /**< Merge multiple SPANs */ > TidyAnchorAsName, /**< Define anchors as name attributes */ >+ TidyClassStartID, /**< Added by Strahinja Markovic: initial value for Tidy CSS class suffix */ > N_TIDY_OPTIONS /**< Must be last */ > } TidyOptionId; > >Index: src/attrs.c >=================================================================== >RCS file: /cvsroot/tidy/tidy/src/attrs.c,v >retrieving revision 1.132 >diff -u -r1.132 attrs.c >--- src/attrs.c 26 Mar 2009 13:05:22 -0000 1.132 >+++ src/attrs.c 9 Apr 2012 19:43:25 -0000 >@@ -599,17 +599,21 @@ > if (!atnam) > return NULL; > >+ /* Changed by Strahinja Markovic: switched all calls to >+ tmbstrcmp into calls to tmbstrcasecmp. This way Tidy >+ compares attribute names in a case-insensitive manner. */ >+ > #if ATTRIBUTE_HASH_LOOKUP > for (p = attribs->hashtab[attrsHash(atnam)]; p && p->attr; p = p->next) >- if (TY_(tmbstrcmp)(atnam, p->attr->name) == 0) >+ if (TY_(tmbstrcasecmp)(atnam, p->attr->name) == 0) > return p->attr; > > for (np = attribute_defs; np && np->name; ++np) >- if (TY_(tmbstrcmp)(atnam, np->name) == 0) >+ if (TY_(tmbstrcasecmp)(atnam, np->name) == 0) > return attrsInstall(doc, attribs, np); > #else > for (np = attribute_defs; np && np->name; ++np) >- if (TY_(tmbstrcmp)(atnam, np->name) == 0) >+ if (TY_(tmbstrcasecmp)(atnam, np->name) == 0) > return np; > #endif > >Index: src/clean.c >=================================================================== >RCS file: /cvsroot/tidy/tidy/src/clean.c,v >retrieving revision 1.111 >diff -u -r1.111 clean.c >--- src/clean.c 14 Oct 2008 12:18:10 -0000 1.111 >+++ src/clean.c 9 Apr 2012 19:43:26 -0000 >@@ -1854,7 +1854,7 @@ > > p = TY_(PutUTF8)(p, c); > } >- node->end = p - lexer->lexbuf; >+ node->end = (uint) (p - lexer->lexbuf); > } > > node = node->next; >@@ -2454,7 +2454,7 @@ > p = TY_(PutUTF8)(p, c); > } > >- node->end = p - lexer->lexbuf; >+ node->end = (uint) (p - lexer->lexbuf); > } > > if (node->content) >Index: src/config.c >=================================================================== >RCS file: /cvsroot/tidy/tidy/src/config.c,v >retrieving revision 1.111 >diff -u -r1.111 config.c >--- src/config.c 18 Jun 2008 20:18:54 -0000 1.111 >+++ src/config.c 9 Apr 2012 19:43:26 -0000 >@@ -315,6 +315,10 @@ > { TidySortAttributes, PP, "sort-attributes", IN, TidySortAttrNone,ParseSorter, sorterPicks }, > { TidyMergeSpans, MU, "merge-spans", IN, TidyAutoState, ParseAutoBool, autoBoolPicks }, > { TidyAnchorAsName, MU, "anchor-as-name", BL, yes, ParseBool, boolPicks }, >+ >+ /* Added by Strahinja Markovic */ >+ { TidyClassStartID, MS, "class-start-id", IN, 0, ParseInt, NULL }, >+ > { N_TIDY_OPTIONS, XX, NULL, XY, 0, NULL, NULL } > }; > >Index: src/lexer.c >=================================================================== >RCS file: /cvsroot/tidy/tidy/src/lexer.c,v >retrieving revision 1.194 >diff -u -r1.194 lexer.c >--- src/lexer.c 22 Mar 2008 21:06:55 -0000 1.194 >+++ src/lexer.c 9 Apr 2012 19:43:26 -0000 >@@ -839,6 +839,13 @@ > > while ( (c = TY_(ReadChar)(doc->docIn)) != EndOfStream ) > { >+ /* Added by Strahinja Markovic: using a colon instead of a semicolon >+ is a frequent typing error. Let's try to handle it. */ >+ if ( c == ':' ) >+ { >+ c = ';'; >+ } >+ > if ( c == ';' ) > { > semicolon = yes; >@@ -945,15 +952,55 @@ > > } > else >- TY_(ReportEntityError)( doc, UNKNOWN_ENTITY, >- lexer->lexbuf+start, ch ); >+ { >+ /* Changed by Strahinja Markovic: >+ When the user has something like "&co." in his >+ source that should really be "&co.", this >+ code makes it happen. >+ */ >+ >+ /* Points to the part of the "entity" after >+ the ampersand. */ >+ tmbstr points_after_amp = lexer->lexbuf + start + 1; >+ uint size = TY_(tmbstrlen)( points_after_amp ); >+ >+ /* 50 bytes should certainly be big enough, >+ but let's try not to introduce buffer overflows anyway. */ >+ if ( size < 50 ) >+ { >+ tmbchar string_after_amp[ 50 + 1 ] = { 0 }; >+ >+ TY_(tmbstrncpy)( string_after_amp, points_after_amp, size + 1 ); >+ >+ /* We move the lexer back to the start of the entity; >+ we will be writing over the old entity value. */ >+ lexer->lexsize = start; >+ >+ AddStringToLexer( lexer, "&" ); >+ AddStringToLexer( lexer, string_after_amp ); >+ } >+ >+ else >+ { >+ TY_(ReportEntityError)( doc, UNKNOWN_ENTITY, >+ lexer->lexbuf+start, ch ); >+ } >+ } > > if (semicolon) > TY_(AddCharToLexer)( lexer, ';' ); > } > else /* naked & */ >- TY_(ReportEntityError)( doc, UNESCAPED_AMPERSAND, >- lexer->lexbuf+start, ch ); >+ { >+ /* Changed by Strahinja Markovic: instead of reporting >+ the error, how about fixing it? */ >+ >+ /*TY_(ReportEntityError)( doc, UNESCAPED_AMPERSAND, >+ lexer->lexbuf+start, ch );*/ >+ >+ if ( cfgBool(doc, TidyQuoteAmpersand) ) >+ AddStringToLexer( lexer, "amp;" ); >+ } > } > else > { >@@ -1567,9 +1614,15 @@ > { > case TidyDoctypeStrict: > /* XHTML 1.0 Strict */ >- TY_(RepairAttrValue)(doc, doctype, pub, GetFPIFromVers(X10S)); >+ /*TY_(RepairAttrValue)(doc, doctype, pub, GetFPIFromVers(X10S)); > TY_(RepairAttrValue)(doc, doctype, sys, GetSIFromVers(X10S)); >- lexer->versionEmitted = X10S; >+ lexer->versionEmitted = X10S;*/ >+ >+ /* Changed by Strahinja Markovic: We need XHTML 1.1 for OPS docs */ >+ /* XHTML 1.1 */ >+ TY_(RepairAttrValue)(doc, doctype, pub, GetFPIFromVers(XH11)); >+ TY_(RepairAttrValue)(doc, doctype, sys, GetSIFromVers(XH11)); >+ lexer->versionEmitted = XH11; > break; > case TidyDoctypeLoose: > /* XHTML 1.0 Transitional */ >@@ -2430,10 +2483,15 @@ > if ((mode != Preformatted && ExpectsContent(lexer->token)) > || nodeIsBR(lexer->token) || nodeIsHR(lexer->token)) > { >- c = TY_(ReadChar)(doc->docIn); >+ /* Changed by Strahinja Markovic: >+ DON'T swallow the newline following the start tag! >+ Why would you ever want to do that for Christ's sake, >+ a newline counts as whitespace too.*/ >+ >+ /*c = TY_(ReadChar)(doc->docIn); > > if (c != '\n' && c != '\f') >- TY_(UngetChar)(c, doc->docIn); >+ TY_(UngetChar)(c, doc->docIn);*/ > > lexer->waswhite = yes; /* to swallow leading whitespace */ > } >@@ -2984,16 +3042,23 @@ > tmbstr attr = NULL; > uint c, lastc; > >+ /* This WILL explode if someone uses an attribute >+ that has more than 50 characters. Fortunately, such >+ attributes don't exist in XHTML, SVG or anything similar.*/ >+ uint attribute_buffer[ 50 ] = { 0 }; >+ int attribute_buffer_index = 0; >+ int index = 0; >+ Bool all_chars_uppercase = yes; >+ > *asp = NULL; /* clear asp pointer */ > *php = NULL; /* clear php pointer */ >- >- /* skip white space before the attribute */ >- >+ >+ /* skip white space before the attribute */ > for (;;) > { > c = TY_(ReadChar)( doc->docIn ); > >- >+ // Tag is ending. > if (c == '/') > { > c = TY_(ReadChar)( doc->docIn ); >@@ -3060,6 +3125,7 @@ > start = lexer->lexsize; > lastc = c; > >+ // Read the attribute name > for (;;) > { > /* but push back '=' for parseValue() */ >@@ -3089,14 +3155,43 @@ > /* what should be done about non-namechar characters? */ > /* currently these are incorporated into the attr name */ > >- if ( !cfgBool(doc, TidyXmlTags) && TY_(IsUpper)(c) ) >- c = TY_(ToLower)(c); >+ attribute_buffer[ attribute_buffer_index ] = c; >+ ++attribute_buffer_index; > >- TY_(AddCharToLexer)( lexer, c ); > lastc = c; > c = TY_(ReadChar)(doc->docIn); > } > >+ /* Are all chars in buffer uppercase? >+ We leave mixed-case names alone. */ >+ for ( index = 0; index < attribute_buffer_index; ++index ) >+ { >+ uint character = attribute_buffer[ index ]; >+ >+ if ( TY_(IsLetter)( character ) && !TY_(IsUpper)( character ) ) >+ { >+ all_chars_uppercase = no; >+ break; >+ } >+ } >+ >+ /* If they are, make them all lowercase */ >+ if ( all_chars_uppercase ) >+ { >+ for ( index = 0; index < attribute_buffer_index; ++index ) >+ { >+ if ( TY_(IsLetter)( attribute_buffer[ index ] ) ) >+ >+ attribute_buffer[ index ] = TY_(ToLower)( attribute_buffer[ index ] ); >+ } >+ } >+ >+ /* Add all the chars from the buffer to the lexer */ >+ for ( index = 0; index < attribute_buffer_index; ++index ) >+ { >+ TY_(AddCharToLexer)( lexer, attribute_buffer[ index ] ); >+ } >+ > /* handle attribute names with multibyte chars */ > len = lexer->lexsize - start; > attr = (len > 0 ? TY_(tmbstrndup)(doc->allocator, >Index: src/localize.c >=================================================================== >RCS file: /cvsroot/tidy/tidy/src/localize.c,v >retrieving revision 1.178 >diff -u -r1.178 localize.c >--- src/localize.c 18 Jun 2008 20:18:54 -0000 1.178 >+++ src/localize.c 9 Apr 2012 19:43:27 -0000 >@@ -882,25 +882,25 @@ > switch ( level ) > { > case TidyInfo: >- TY_(tmbstrncpy)( buf, "Info: ", count ); >+ TY_(tmbstrncpy)( buf, "Info: ", (uint) count ); > break; > case TidyWarning: >- TY_(tmbstrncpy)( buf, "Warning: ", count ); >+ TY_(tmbstrncpy)( buf, "Warning: ", (uint) count ); > break; > case TidyConfig: >- TY_(tmbstrncpy)( buf, "Config: ", count ); >+ TY_(tmbstrncpy)( buf, "Config: ", (uint) count ); > break; > case TidyAccess: >- TY_(tmbstrncpy)( buf, "Access: ", count ); >+ TY_(tmbstrncpy)( buf, "Access: ", (uint) count ); > break; > case TidyError: >- TY_(tmbstrncpy)( buf, "Error: ", count ); >+ TY_(tmbstrncpy)( buf, "Error: ", (uint) count ); > break; > case TidyBadDocument: >- TY_(tmbstrncpy)( buf, "Document: ", count ); >+ TY_(tmbstrncpy)( buf, "Document: ", (uint) count ); > break; > case TidyFatal: >- TY_(tmbstrncpy)( buf, "panic: ", count ); >+ TY_(tmbstrncpy)( buf, "panic: ", (uint) count ); > break; > } > return buf + TY_(tmbstrlen)( buf ); >@@ -1373,14 +1373,14 @@ > { > ctmbstr fmt = GetFormatFromCode(code); > doc->badAccess |= BA_WAI; >- messageNode( doc, TidyAccess, node, fmt ); >+ messageNode( doc, TidyAccess, node, "%s", fmt ); > } > > void TY_(ReportAccessError)( TidyDocImpl* doc, Node* node, uint code ) > { > ctmbstr fmt = GetFormatFromCode(code); > doc->badAccess |= BA_WAI; >- messageNode( doc, TidyAccess, node, fmt ); >+ messageNode( doc, TidyAccess, node, "%s", fmt ); > } > > #endif /* SUPPORT_ACCESSIBILITY_CHECKS */ >@@ -1399,7 +1399,7 @@ > switch (code) > { > case NESTED_QUOTATION: >- messageNode(doc, TidyWarning, rpt, fmt); >+ messageNode(doc, TidyWarning, rpt, "%s", fmt); > break; > > case OBSOLETE_ELEMENT: >@@ -1480,7 +1480,7 @@ > case INCONSISTENT_NAMESPACE: > case DOCTYPE_AFTER_TAGS: > case DTYPE_NOT_UPPER_CASE: >- messageNode(doc, TidyWarning, rpt, fmt); >+ messageNode(doc, TidyWarning, rpt, "%s", fmt); > break; > > case COERCE_TO_ENDTAG: >@@ -1499,7 +1499,7 @@ > case ENCODING_IO_CONFLICT: > case MISSING_DOCTYPE: > case SPACE_PRECEDING_XMLDECL: >- messageNode(doc, TidyWarning, node, fmt); >+ messageNode(doc, TidyWarning, node, "%s", fmt); > break; > > case TRIM_EMPTY_ELEMENT: >@@ -1548,7 +1548,7 @@ > { > case SUSPECTED_MISSING_QUOTE: > case DUPLICATE_FRAMESET: >- messageNode(doc, TidyError, rpt, fmt); >+ messageNode(doc, TidyError, rpt, "%s", fmt); > break; > > case UNKNOWN_ELEMENT: >Index: src/parser.c >=================================================================== >RCS file: /cvsroot/tidy/tidy/src/parser.c,v >retrieving revision 1.188 >diff -u -r1.188 parser.c >--- src/parser.c 27 Oct 2009 19:27:49 -0000 1.188 >+++ src/parser.c 9 Apr 2012 19:43:27 -0000 >@@ -5,9 +5,9 @@ > > CVS Info : > >- $Author: krusch $ >- $Date: 2009/10/27 19:27:49 $ >- $Revision: 1.188 $ >+ $Author: arnaud02 $ >+ $Date: 2008/03/22 20:02:42 $ >+ $Revision: 1.187 $ > > */ > >@@ -3468,11 +3468,8 @@ > } > else if (node->tag->model & (CM_TABLE | CM_ROWGRP | CM_ROW)) > { >- /* http://tidy.sf.net/issue/2855621 */ >- if (node->type != EndTag) { >- TY_(UngetToken)( doc ); >- node = TY_(InferredTag)(doc, TidyTag_TABLE); >- } >+ TY_(UngetToken)( doc ); >+ node = TY_(InferredTag)(doc, TidyTag_TABLE); > lexer->excludeBlocks = yes; > } > else if ( nodeIsINPUT(node) ) >Index: src/pprint.c >=================================================================== >RCS file: /cvsroot/tidy/tidy/src/pprint.c,v >retrieving revision 1.119 >diff -u -r1.119 pprint.c >--- src/pprint.c 22 Mar 2008 20:23:37 -0000 1.119 >+++ src/pprint.c 9 Apr 2012 19:43:28 -0000 >@@ -2023,14 +2023,19 @@ > PPrintTag( doc, mode, indent, node ); > > indent = 0; >- TY_(PFlushLine)( doc, indent ); >+ >+ if ( !nodeIsPRE(node) ) >+ TY_(PFlushLine)( doc, indent ); > > for ( content = node->content; content; content = content->next ) > { > TY_(PPrintTree)( doc, (mode | PREFORMATTED | NOWRAP), > indent, content ); > } >- PCondFlushLine( doc, indent ); >+ >+ if ( !nodeIsPRE(node) ) >+ PCondFlushLine( doc, indent ); >+ > indent = indprev; > PPrintEndTag( doc, mode, indent, node ); > >Index: src/tidylib.c >=================================================================== >RCS file: /cvsroot/tidy/tidy/src/tidylib.c,v >retrieving revision 1.75 >diff -u -r1.75 tidylib.c >--- src/tidylib.c 18 Jun 2008 20:18:54 -0000 1.75 >+++ src/tidylib.c 9 Apr 2012 19:43:28 -0000 >@@ -915,6 +915,9 @@ > TidyBuffer inbuf; > StreamIn* in = NULL; > >+ /* Ugly hack added by Strahinja Markovic */ >+ doc->nClassId = cfg(doc, TidyClassStartID); >+ > if ( content ) > { > tidyBufInitWithAllocator( &inbuf, doc->allocator ); >@@ -1324,7 +1327,10 @@ > TY_(SetXHTMLDocType)(doc); > TY_(FixAnchors)(doc, &doc->root, wantNameAttr, yes); > TY_(FixXhtmlNamespace)(doc, yes); >- TY_(FixLanguageInformation)(doc, &doc->root, yes, yes); >+ >+ /* Change by Strahinja Markovic - changed "yes, yes" to "yes, no"; >+ the 'lang' is attribute not allowed for XHTML 1.1.*/ >+ TY_(FixLanguageInformation)(doc, &doc->root, yes, no); > } > else > {
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 772362
: 576293