diff --git a/src/config.c b/src/config.c index 4a132f5..09c1f5f 100644 --- a/src/config.c +++ b/src/config.c @@ -1291,6 +1291,12 @@ void TY_(AdjustConfig)( TidyDocImpl* doc ) TY_(SetOptionBool)( doc, TidyQuoteAmpersand, yes ); TY_(SetOptionBool)( doc, TidyOmitOptionalTags, no ); } + + /* Setup the indent character. */ + if cfgBool(doc, TidyPPrintTabs) + doc->indent_char = '\t'; + else + doc->indent_char = ' '; } diff --git a/src/tidylib.c b/src/tidylib.c index 4b7dfcb..d88cd9f 100644 --- a/src/tidylib.c +++ b/src/tidylib.c @@ -2253,16 +2253,11 @@ int tidyDocSaveStream( TidyDocImpl* doc, StreamOut* out ) Bool asciiChars = cfgBool(doc, TidyAsciiChars); Bool makeBare = cfgBool(doc, TidyMakeBare); Bool escapeCDATA = cfgBool(doc, TidyEscapeCdata); - Bool ppWithTabs = cfgBool(doc, TidyPPrintTabs); TidyAttrSortStrategy sortAttrStrat = cfg(doc, TidySortAttributes); TidyConfigChangeCallback callback = doc->pConfigChangeCallback; doc->pConfigChangeCallback = NULL; - if (ppWithTabs) - doc->indent_char = '\t'; - else - doc->indent_char = ' '; - + if (escapeCDATA) TY_(ConvertCDATANodes)(doc, &doc->root);