From 0a5f59a9aa25b3de7e9659b39ad201aaf7eb5a67 Mon Sep 17 00:00:00 2001 From: Hans Hagen Date: Fri, 27 Sep 2019 20:24:34 +0200 Subject: 2019-09-27 18:10:00 --- tex/context/base/mkiv/lxml-css.lua | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) (limited to 'tex/context/base/mkiv/lxml-css.lua') diff --git a/tex/context/base/mkiv/lxml-css.lua b/tex/context/base/mkiv/lxml-css.lua index b0f5c9b72..8f7f19e84 100644 --- a/tex/context/base/mkiv/lxml-css.lua +++ b/tex/context/base/mkiv/lxml-css.lua @@ -146,9 +146,11 @@ if context then end +local p_digit = lpeg.patterns.digit + local pattern = Cf( Ct("") * ( Cg( - Cc("style") * ( + Cc("style") * ( C("italic") + C("oblique") + C("slanted") / "oblique" @@ -156,12 +158,17 @@ local pattern = Cf( Ct("") * ( + Cc("variant") * ( (C("smallcaps") + C("caps")) / "small-caps" ) - + Cc("weight") * + + Cc("weight") * ( C("bold") - + Cc("family") * ( - (C("mono") + C("type")) / "monospace" -- just ignore the "space(d)" + ) + + Cc("family") * ( + (C("mono") + C("type")) / "monospace" -- just ignore the "space(d)" + (C("sansserif") + C("sans")) / "sans-serif" -- match before serif - + C("serif") + + C("serif") + ) + + Cc("size") * Ct ( + (S("+-")^0 * (p_digit^0 * P(".") * p_digit^1 + p_digit^1 * P(".") + p_digit^1)) / tonumber + * C(P("p") * S("txc") + P("e") * S("xm") + S("mc") * P("m") + P("in") + P("%")) ) ) --+ P("\\") * ( -- cgit v1.2.3