diff --git a/src/config.c b/src/config.c index 5ca18f8..b44a1b8 100644 --- a/src/config.c +++ b/src/config.c @@ -1229,10 +1229,8 @@ Bool ParseTabs( TidyDocImpl* doc, const TidyOptionImpl* entry ) Bool tabs = flag != 0 ? yes : no; TY_(SetOptionBool)( doc, entry->id, tabs ); if (tabs) { - TY_(PPrintTabs)(); TY_(SetOptionInt)( doc, TidyIndentSpaces, 1 ); } else { - TY_(PPrintSpaces)(); /* optional - TY_(ResetOptionToDefault)( doc, TidyIndentSpaces ); */ } } diff --git a/src/tidylib.c b/src/tidylib.c index 69ac014..7501607 100755 --- a/src/tidylib.c +++ b/src/tidylib.c @@ -1809,8 +1809,14 @@ 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); + if (ppWithTabs) + TY_(PPrintTabs)(); + else + TY_(PPrintSpaces)(); + if (escapeCDATA) TY_(ConvertCDATANodes)(doc, &doc->root);