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:
parent
963caf0741
commit
5d5e689f1a
12
src/parser.c
12
src/parser.c
|
@ -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)
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue