parent
a2065f8283
commit
f49386e191
|
@ -657,7 +657,7 @@ typedef enum
|
||||||
TidyWrapAttVals, /**< Wrap within attribute values */
|
TidyWrapAttVals, /**< Wrap within attribute values */
|
||||||
TidyWrapJste, /**< Wrap within JSTE pseudo elements */
|
TidyWrapJste, /**< Wrap within JSTE pseudo elements */
|
||||||
TidyWrapLen, /**< Wrap margin */
|
TidyWrapLen, /**< Wrap margin */
|
||||||
TidyWrapPhp, /**< Wrap within PHP pseudo elements */
|
TidyWrapPhp, /**< Wrap consecutive PHP pseudo elements */
|
||||||
TidyWrapScriptlets, /**< Wrap within JavaScript string literals */
|
TidyWrapScriptlets, /**< Wrap within JavaScript string literals */
|
||||||
TidyWrapSection, /**< Wrap within <![ ... ]> section tags */
|
TidyWrapSection, /**< Wrap within <![ ... ]> section tags */
|
||||||
TidyWriteBack, /**< If true then output tidied markup */
|
TidyWriteBack, /**< If true then output tidied markup */
|
||||||
|
|
|
@ -265,7 +265,7 @@ static const TidyOptionImpl option_defs[] =
|
||||||
{ TidyWrapAttVals, PP, "wrap-attributes", BL, no, ParsePickList, &boolPicks },
|
{ TidyWrapAttVals, PP, "wrap-attributes", BL, no, ParsePickList, &boolPicks },
|
||||||
{ TidyWrapJste, PP, "wrap-jste", BL, yes, ParsePickList, &boolPicks },
|
{ TidyWrapJste, PP, "wrap-jste", BL, yes, ParsePickList, &boolPicks },
|
||||||
{ TidyWrapLen, PP, "wrap", IN, 68, ParseInt, NULL },
|
{ TidyWrapLen, PP, "wrap", IN, 68, ParseInt, NULL },
|
||||||
{ TidyWrapPhp, PP, "wrap-php", BL, yes, ParsePickList, &boolPicks },
|
{ TidyWrapPhp, PP, "wrap-php", BL, no, ParsePickList, &boolPicks },
|
||||||
{ TidyWrapScriptlets, PP, "wrap-script-literals", BL, no, ParsePickList, &boolPicks },
|
{ TidyWrapScriptlets, PP, "wrap-script-literals", BL, no, ParsePickList, &boolPicks },
|
||||||
{ TidyWrapSection, PP, "wrap-sections", BL, yes, ParsePickList, &boolPicks },
|
{ TidyWrapSection, PP, "wrap-sections", BL, yes, ParsePickList, &boolPicks },
|
||||||
{ TidyWriteBack, IO, "write-back", BL, no, ParsePickList, &boolPicks },
|
{ TidyWriteBack, IO, "write-back", BL, no, ParsePickList, &boolPicks },
|
||||||
|
|
|
@ -1492,7 +1492,7 @@ static languageDefinition language_en = { whichPluralForm_en, {
|
||||||
- The strings "Tidy" and "HTML Tidy" are the program name and must not
|
- The strings "Tidy" and "HTML Tidy" are the program name and must not
|
||||||
be translated. */
|
be translated. */
|
||||||
TidyWrapPhp, 0,
|
TidyWrapPhp, 0,
|
||||||
"This option specifies if Tidy should line wrap text contained within PHP "
|
"This option specifies if Tidy should add a new line after a PHP "
|
||||||
"pseudo elements, which look like: <code><?php ... ?></code>. "
|
"pseudo elements, which look like: <code><?php ... ?></code>. "
|
||||||
},
|
},
|
||||||
{/* Important notes for translators:
|
{/* Important notes for translators:
|
||||||
|
|
12
src/pprint.c
12
src/pprint.c
|
@ -1699,15 +1699,17 @@ static void PPrintPhp( TidyDocImpl* doc, uint indent, Node *node )
|
||||||
{
|
{
|
||||||
TidyPrintImpl* pprint = &doc->pprint;
|
TidyPrintImpl* pprint = &doc->pprint;
|
||||||
Bool wrapPhp = cfgBool( doc, TidyWrapPhp );
|
Bool wrapPhp = cfgBool( doc, TidyWrapPhp );
|
||||||
uint saveWrap = WrapOffCond( doc, !wrapPhp );
|
/* uint saveWrap = WrapOffCond( doc, !wrapPhp ); */
|
||||||
|
|
||||||
AddString( pprint, "<?" );
|
AddString( pprint, "<?" );
|
||||||
PPrintText( doc, (wrapPhp ? CDATA : COMMENT),
|
PPrintText( doc, CDATA, indent, node );
|
||||||
indent, node );
|
|
||||||
AddString( pprint, "?>" );
|
AddString( pprint, "?>" );
|
||||||
|
|
||||||
/* PCondFlushLine( doc, indent ); */
|
/* Issue #437 - add a new line if 'wrap-php' is on */
|
||||||
WrapOn( doc, saveWrap );
|
if (wrapPhp)
|
||||||
|
PCondFlushLine( doc, indent );
|
||||||
|
|
||||||
|
/* WrapOn( doc, saveWrap ); */
|
||||||
}
|
}
|
||||||
|
|
||||||
static void PPrintCDATA( TidyDocImpl* doc, uint indent, Node *node )
|
static void PPrintCDATA( TidyDocImpl* doc, uint indent, Node *node )
|
||||||
|
|
Loading…
Reference in a new issue