Set the indent character in a more appropriate spot.
The previous location was fine when saving the output stream, but it led to unset character when using node interrogation, which _also_ uses the pretty printers to get text. This is a more appropriate location to set the character. This is the first instance of our cool Swift wrapper API tester catching an issue for us. Nice! Proof that the automated API
This commit is contained in:
parent
0fe913eb76
commit
1d2a183f32
|
@ -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 = ' ';
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -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);
|
||||
|
||||
|
|
Loading…
Reference in a new issue