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:
authorRonan Collobert <ronan@collobert.com>2015-08-11 04:43:42 +0300
committerRonan Collobert <ronan@collobert.com>2015-08-11 04:43:42 +0300
commitcdef0eb010fb5588eab885fbad24ea840874d4a4 (patch)
tree92d0c86a46e81001f116e3d7ada88dd296f2f996
parente8d58d9e852c729e010cb8b8192f2f7abb0d169a (diff)
parent8aed9c75eb55faccba1c6f28adb6bd6f50142f2d (diff)
Merge pull request #9 from nicholas-leonard/xhtml
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