merge @camoy fix #158 to this branch
This commit is contained in:
parent
d26cd72084
commit
ae620a63a2
11
src/pprint.c
11
src/pprint.c
|
@ -2192,26 +2192,27 @@ void TY_(PPrintTree)( TidyDocImpl* doc, uint mode, uint indent, Node *node )
|
||||||
{
|
{
|
||||||
Bool classic = TidyClassicVS; /* #228 - cfgBool( doc, TidyVertSpace ); */
|
Bool classic = TidyClassicVS; /* #228 - cfgBool( doc, TidyVertSpace ); */
|
||||||
uint indprev = indent;
|
uint indprev = indent;
|
||||||
PCondFlushLineSmart( doc, indent );
|
|
||||||
|
|
||||||
PCondFlushLineSmart( doc, indent );
|
PCondFlushLineSmart( doc, indent ); /* about to add <pre> tag - clear any previous */
|
||||||
|
|
||||||
/* insert extra newline for classic formatting */
|
/* insert extra newline for classic formatting */
|
||||||
if (classic && node->parent && node->parent->content != node)
|
if (classic && node->parent && node->parent->content != node)
|
||||||
{
|
{
|
||||||
TY_(PFlushLineSmart)( doc, indent );
|
TY_(PFlushLineSmart)( doc, indent );
|
||||||
}
|
}
|
||||||
PPrintTag( doc, mode, indent, node );
|
|
||||||
|
PPrintTag( doc, mode, indent, node ); /* add <pre> or <textarea> tag */
|
||||||
|
|
||||||
indent = 0;
|
indent = 0;
|
||||||
TY_(PFlushLineSmart)( doc, indent );
|
/* @camoy Fix #158 - remove inserted newlines in pre - TY_(PFlushLineSmart)( doc, indent ); */
|
||||||
|
|
||||||
for ( content = node->content; content; content = content->next )
|
for ( content = node->content; content; content = content->next )
|
||||||
{
|
{
|
||||||
TY_(PPrintTree)( doc, (mode | PREFORMATTED | NOWRAP),
|
TY_(PPrintTree)( doc, (mode | PREFORMATTED | NOWRAP),
|
||||||
indent, content );
|
indent, content );
|
||||||
}
|
}
|
||||||
PCondFlushLineSmart( doc, indent );
|
|
||||||
|
/* @camoy Fix #158 - remove inserted newlines in pre - PCondFlushLineSmart( doc, indent ); */
|
||||||
indent = indprev;
|
indent = indprev;
|
||||||
PPrintEndTag( doc, mode, indent, node );
|
PPrintEndTag( doc, mode, indent, node );
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue