texlive[48015] Master/texmf-dist: luaxml (14jun18)
commits+karl at tug.org
commits+karl at tug.org
Thu Jun 14 23:41:01 CEST 2018
Revision: 48015
http://tug.org/svn/texlive?view=revision&revision=48015
Author: karl
Date: 2018-06-14 23:41:00 +0200 (Thu, 14 Jun 2018)
Log Message:
-----------
luaxml (14jun18)
Modified Paths:
--------------
trunk/Master/texmf-dist/doc/luatex/luaxml/README
trunk/Master/texmf-dist/doc/luatex/luaxml/luaxml.pdf
trunk/Master/texmf-dist/doc/luatex/luaxml/luaxml.tex
trunk/Master/texmf-dist/tex/luatex/luaxml/luaxml-cssquery.lua
trunk/Master/texmf-dist/tex/luatex/luaxml/luaxml-parse-query.lua
Modified: trunk/Master/texmf-dist/doc/luatex/luaxml/README
===================================================================
--- trunk/Master/texmf-dist/doc/luatex/luaxml/README 2018-06-14 06:17:13 UTC (rev 48014)
+++ trunk/Master/texmf-dist/doc/luatex/luaxml/README 2018-06-14 21:41:00 UTC (rev 48015)
@@ -29,7 +29,7 @@
------
Michal Hoftich
Email: michal.h21 at gmail.com
-Version: 0.1b
+Version: 0.1c
Original authors: Paul Chakravarti and Manoel Campos (http://manoelcampos.com)
Modified: trunk/Master/texmf-dist/doc/luatex/luaxml/luaxml.pdf
===================================================================
(Binary files differ)
Modified: trunk/Master/texmf-dist/doc/luatex/luaxml/luaxml.tex
===================================================================
--- trunk/Master/texmf-dist/doc/luatex/luaxml/luaxml.tex 2018-06-14 06:17:13 UTC (rev 48014)
+++ trunk/Master/texmf-dist/doc/luatex/luaxml/luaxml.tex 2018-06-14 21:41:00 UTC (rev 48015)
@@ -7,7 +7,7 @@
\usepackage{framed}
% Version is defined in the makefile, use default values when compiled directly
\ifdefined\version\else
-\def\version{0.1b}
+\def\version{0.1c}
\let\gitdate\date
\fi
\newcommand\modulename[1]{\subsection{#1}\label{sec:#1}}
@@ -152,6 +152,8 @@
\end{luacode*}
\end{framed}
+It supports also |XML| namespaces, using \verb_namespace|element_ syntax.
+
\subsection{Element traversing}
\subsubsection{The \texttt{DOM\_Object:traverse\_elements} method}
Modified: trunk/Master/texmf-dist/tex/luatex/luaxml/luaxml-cssquery.lua
===================================================================
--- trunk/Master/texmf-dist/tex/luatex/luaxml/luaxml-cssquery.lua 2018-06-14 06:17:13 UTC (rev 48014)
+++ trunk/Master/texmf-dist/tex/luatex/luaxml/luaxml-cssquery.lua 2018-06-14 21:41:00 UTC (rev 48015)
@@ -123,7 +123,9 @@
return nodelist
end
- --- Parse CSS selector to query table
+ --- Parse CSS selector to a query table.
+ -- XML namespaces can be supported using
+ -- namespace|element syntax
-- @return table querylist
function CssQuery:prepare_selector(
selector -- string CSS selector query
@@ -138,6 +140,14 @@
for _, atom in ipairs(part) do
local key = atom[1]
local value = atom[2]
+ -- support for XML namespaces in selectors
+ -- the namespace should be added using "|"
+ -- like namespace|element
+ if key=="tag" then
+ -- LuaXML doesn't support namespaces, so it is necessary
+ -- to match namespace:element
+ value=value:gsub("|", ":")
+ end
t[key] = value
end
query[#query + 1] = t
Modified: trunk/Master/texmf-dist/tex/luatex/luaxml/luaxml-parse-query.lua
===================================================================
--- trunk/Master/texmf-dist/tex/luatex/luaxml/luaxml-parse-query.lua 2018-06-14 06:17:13 UTC (rev 48014)
+++ trunk/Master/texmf-dist/tex/luatex/luaxml/luaxml-parse-query.lua 2018-06-14 21:41:00 UTC (rev 48015)
@@ -13,7 +13,10 @@
local alphanum = R("az", "AZ", "09")
local num = R("09")
local white = S(" \t\n") ^ 0
-local word = (alphanum + S("_-")) ^ 1
+-- this is a deviation from the upstream, we allow ":" in the tag name, because
+-- luaxml doesn't support XML namespaces and elements must be queried using
+-- dom:query_selector("namespace:element")
+local word = (alphanum + S("_-") + S("|")) ^ 1
local mark
mark = function(name)
return function(...)
More information about the tex-live-commits
mailing list