summaryrefslogtreecommitdiff
path: root/Master
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2018-06-14 21:41:00 +0000
committerKarl Berry <karl@freefriends.org>2018-06-14 21:41:00 +0000
commite01f1b9c17b6436584bc92c7ae50151fd8e8205d (patch)
treed56f74728cd1737b7a86c3cc2c15e6b216faebb6 /Master
parent5c25b51ce087f0f8464448ac3ad03f16c16b35be (diff)
luaxml (14jun18)
git-svn-id: svn://tug.org/texlive/trunk@48015 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master')
-rw-r--r--Master/texmf-dist/doc/luatex/luaxml/README2
-rw-r--r--Master/texmf-dist/doc/luatex/luaxml/luaxml.pdfbin98298 -> 96782 bytes
-rw-r--r--Master/texmf-dist/doc/luatex/luaxml/luaxml.tex4
-rw-r--r--Master/texmf-dist/tex/luatex/luaxml/luaxml-cssquery.lua12
-rw-r--r--Master/texmf-dist/tex/luatex/luaxml/luaxml-parse-query.lua5
5 files changed, 19 insertions, 4 deletions
diff --git a/Master/texmf-dist/doc/luatex/luaxml/README b/Master/texmf-dist/doc/luatex/luaxml/README
index 4017d861b84..a25ba1f862e 100644
--- a/Master/texmf-dist/doc/luatex/luaxml/README
+++ b/Master/texmf-dist/doc/luatex/luaxml/README
@@ -29,7 +29,7 @@ Author
------
Michal Hoftich
Email: michal.h21@gmail.com
-Version: 0.1b
+Version: 0.1c
Original authors: Paul Chakravarti and Manoel Campos (http://manoelcampos.com)
diff --git a/Master/texmf-dist/doc/luatex/luaxml/luaxml.pdf b/Master/texmf-dist/doc/luatex/luaxml/luaxml.pdf
index 33051ab1c8b..3ccb1d9c67e 100644
--- a/Master/texmf-dist/doc/luatex/luaxml/luaxml.pdf
+++ b/Master/texmf-dist/doc/luatex/luaxml/luaxml.pdf
Binary files differ
diff --git a/Master/texmf-dist/doc/luatex/luaxml/luaxml.tex b/Master/texmf-dist/doc/luatex/luaxml/luaxml.tex
index bd6728e691b..9a4de25edf7 100644
--- a/Master/texmf-dist/doc/luatex/luaxml/luaxml.tex
+++ b/Master/texmf-dist/doc/luatex/luaxml/luaxml.tex
@@ -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
\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}
diff --git a/Master/texmf-dist/tex/luatex/luaxml/luaxml-cssquery.lua b/Master/texmf-dist/tex/luatex/luaxml/luaxml-cssquery.lua
index 9f283ed6e64..558f72089bc 100644
--- a/Master/texmf-dist/tex/luatex/luaxml/luaxml-cssquery.lua
+++ b/Master/texmf-dist/tex/luatex/luaxml/luaxml-cssquery.lua
@@ -123,7 +123,9 @@ local function cssquery()
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 @@ local function cssquery()
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
diff --git a/Master/texmf-dist/tex/luatex/luaxml/luaxml-parse-query.lua b/Master/texmf-dist/tex/luatex/luaxml/luaxml-parse-query.lua
index 95679670529..7931fa193fc 100644
--- a/Master/texmf-dist/tex/luatex/luaxml/luaxml-parse-query.lua
+++ b/Master/texmf-dist/tex/luatex/luaxml/luaxml-parse-query.lua
@@ -13,7 +13,10 @@ end
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(...)