For issue #212, retain mixed mode block parsing.

This is particularly for the anchor tag which in html5 mode is parsed in
ParseBlock. That is retain a leading space, in case it needs to be
moved to in front of the block to keep space rendering.
This commit is contained in:
Geoff McLane 2015-05-13 12:31:23 +02:00
parent 963caf0741
commit 5d5e689f1a
1 changed files with 11 additions and 1 deletions

View File

@ -895,7 +895,17 @@ void TY_(ParseBlock)( TidyDocImpl* doc, Node *element, GetTokenMode mode)
if (!(element->tag->model & CM_MIXED))
TY_(InlineDup)( doc, NULL );
mode = IgnoreWhitespace;
/*\
* Issue #212 - If it is likely that it may be necessary
* to move a leading space into a text node before this
* element, then keep the mode MixedContent to keep any
* leading space
\*/
if ( !(element->tag->model & CM_INLINE) ||
(element->tag->model & CM_FIELD ) )
{
mode = IgnoreWhitespace;
}
while ((node = TY_(GetToken)(doc, mode /*MixedContent*/)) != NULL)
{