Commit 4c1fff6c authored by Vadim Zaslavsky's avatar Vadim Zaslavsky Committed by mrbean-bremen
Browse files

Font shorthand parsing fixed

See ExCSS pull request #62: https://github.com/TylerBrinks/ExCSS/pull/62
parent 38d6c5e2
......@@ -119,5 +119,13 @@ namespace ExCSS
Comma,
Space
}
internal void SetLastTerm(Term term)
{
if (Length == 0)
AddTerm(term);
else
_items[Length - 1] = term;
}
}
}
......@@ -131,18 +131,18 @@ namespace ExCSS
private bool AddTerm(Term value)
{
var added = true;
if (_isFraction)
{
if (_terms.Length > 0)
{
value = new PrimitiveTerm(UnitType.Unknown, _terms[0] + "/" + value);
_terms = new TermList();
value = new PrimitiveTerm(UnitType.Unknown, _terms[_terms.Length - 1] + "/" + value);
}
_terms.SetLastTerm(value);
_isFraction = false;
}
if (_functionBuffers.Count > 0)
else if (_functionBuffers.Count > 0)
{
_functionBuffers.Peek().TermList.Add(value);
}
......@@ -156,10 +156,10 @@ namespace ExCSS
}
else
{
return false;
added = false;
}
return true;
return added;
}
private void FinalizeProperty()
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment