diff options
author | Norbert Preining <norbert@preining.info> | 2020-07-21 03:03:08 +0000 |
---|---|---|
committer | Norbert Preining <norbert@preining.info> | 2020-07-21 03:03:08 +0000 |
commit | bd36712a3846fe8b17a13b5edfdcf10dc8787235 (patch) | |
tree | a03524b06804f090ad8364af839219776d17dd70 /macros/luatex/generic/luaxml | |
parent | 7a37d65d52056a1500d4602172582154994bea64 (diff) |
CTAN sync 202007210303
Diffstat (limited to 'macros/luatex/generic/luaxml')
-rw-r--r-- | macros/luatex/generic/luaxml/README | 2 | ||||
-rw-r--r-- | macros/luatex/generic/luaxml/luaxml-domobject.lua | 7 | ||||
-rw-r--r-- | macros/luatex/generic/luaxml/luaxml-namedentities.lua | 3 | ||||
-rw-r--r-- | macros/luatex/generic/luaxml/luaxml.pdf | bin | 98710 -> 99665 bytes | |||
-rw-r--r-- | macros/luatex/generic/luaxml/luaxml.tex | 18 |
5 files changed, 26 insertions, 4 deletions
diff --git a/macros/luatex/generic/luaxml/README b/macros/luatex/generic/luaxml/README index 897968a391..ab8a407dd0 100644 --- a/macros/luatex/generic/luaxml/README +++ b/macros/luatex/generic/luaxml/README @@ -28,7 +28,7 @@ Author ------ Michal Hoftich Email: michal.h21@gmail.com -Version: 0.1l, 2019-09-16 +Version: v0.1m, 2020-07-19 Original authors: Paul Chakravarti and Manoel Campos (http://manoelcampos.com) diff --git a/macros/luatex/generic/luaxml/luaxml-domobject.lua b/macros/luatex/generic/luaxml/luaxml-domobject.lua index 413947b5d4..6d299d4157 100644 --- a/macros/luatex/generic/luaxml/luaxml-domobject.lua +++ b/macros/luatex/generic/luaxml/luaxml-domobject.lua @@ -115,7 +115,12 @@ local function serialize_dom(parser, current,level, output) attributes["_text"] = nil elseif xtype == "DECL" and name =="xml" then -- the xml declaration attributes must be in a correct order - insert("<?xml version='%s' encoding='%s' ?>", attributes.version, attributes.encoding) + local encoding = attributes.encoding or "utf-8" + insert("<?xml version='%s' encoding='%s' ?>", attributes.version, encoding) + return output + elseif xtype == "CDATA" then + -- return content unescaped + insert(string.format("<![CDATA[%s]]>", text_content)) return output end diff --git a/macros/luatex/generic/luaxml/luaxml-namedentities.lua b/macros/luatex/generic/luaxml/luaxml-namedentities.lua index dbbed79ce0..9a26f448f6 100644 --- a/macros/luatex/generic/luaxml/luaxml-namedentities.lua +++ b/macros/luatex/generic/luaxml/luaxml-namedentities.lua @@ -1,3 +1,4 @@ +local utf8 = require "utf8" return { ["Subset"]="⋐", ["Chi"]="Χ", @@ -39,7 +40,7 @@ return { ["nsqsube"]="⋢", ["Nacute"]="Ń", ["mcomma"]="⨩", -["ApplyFunction"]="", +["ApplyFunction"]=utf8.char(8289), ["rfisht"]="⥽", ["phmmat"]="ℳ", ["rarrw"]="↝", diff --git a/macros/luatex/generic/luaxml/luaxml.pdf b/macros/luatex/generic/luaxml/luaxml.pdf Binary files differindex 6b53c44891..86aa928593 100644 --- a/macros/luatex/generic/luaxml/luaxml.pdf +++ b/macros/luatex/generic/luaxml/luaxml.pdf diff --git a/macros/luatex/generic/luaxml/luaxml.tex b/macros/luatex/generic/luaxml/luaxml.tex index 3b451fdb63..d641b91aad 100644 --- a/macros/luatex/generic/luaxml/luaxml.tex +++ b/macros/luatex/generic/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.1l} +\def\version{v0.1m} \let\gitdate\date \fi \newcommand\modulename[1]{\subsection{#1}\label{sec:#1}} @@ -99,6 +99,22 @@ end \end{luacode*} \end{framed} +\subsection{Void elements} + +The \verb|DOM_Object.parse| function tries to support the HTML void elements, +such as \verb|<img>| or \verb|<hr>|. They cannot have closing tags, a parse +error occurs when the closing tags are used. + +It is possible to define a different set of void elements using the second parameter +for \verb|DOM_Object.parse|: + +\begin{verbatim} +obj = dom.parse(document, {custom_void = true}) +\end{verbatim} + +An empty table will disable all void elements. This setting is recommended for common |xml| documents. + + \subsection{Node selection methods} There are some other methods for element retrieving. |