Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/torch/dok.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authornicholas-leonard <nick@nikopia.org>2015-08-11 03:27:37 +0300
committernicholas-leonard <nick@nikopia.org>2015-08-11 04:36:06 +0300
commit8aed9c75eb55faccba1c6f28adb6bd6f50142f2d (patch)
tree92d0c86a46e81001f116e3d7ada88dd296f2f996
parente8d58d9e852c729e010cb8b8192f2f7abb0d169a (diff)
works with xhtml anchors
-rw-r--r--inline.lua3
1 files changed, 2 insertions, 1 deletions
diff --git a/inline.lua b/inline.lua
index 48eccc3..162f868 100644
--- a/inline.lua
+++ b/inline.lua
@@ -248,7 +248,8 @@ function dok.html2funcs(html, package)
local canchor
local lines = {}
for line in html:gmatch('[^\n\r]+') do
- local anchor = line:match('<a.-name="(.-)"/>')
+ local anchor = line:match('<a.-name=["\'](.-)["\']/>')
+ or line:match('<a.-name=["\'](.-)["\']>.-</a>')
local level, name = line:match('<h(%d)>(.*)</h%d>')
if anchor then
canchor = anchor