mirror of
https://github.com/correl/melpa.git
synced 2024-12-22 19:17:27 +00:00
Parse archive-contents file more rigorously when building the html index (fixes #49)
This commit is contained in:
parent
466327d532
commit
ca5fdf6ea9
1 changed files with 3 additions and 1 deletions
|
@ -17,7 +17,7 @@
|
||||||
<%
|
<%
|
||||||
def parse str
|
def parse str
|
||||||
# credit to: http://stackoverflow.com/q/3128406/154508
|
# credit to: http://stackoverflow.com/q/3128406/154508
|
||||||
tokens = str.scan(/#{Regexp.escape("(")}|#{Regexp.escape(")")}|[a-zA-Z0-9\'\-\_\+]+/)
|
tokens = str.scan(/#{Regexp.escape("(")}|#{Regexp.escape(")")}|"(?:\\.|[^"])+"|[a-zA-Z0-9\'\-\_\+]+/)
|
||||||
|
|
||||||
stack = [[]]
|
stack = [[]]
|
||||||
|
|
||||||
|
@ -27,6 +27,8 @@
|
||||||
stack << []
|
stack << []
|
||||||
when ")"
|
when ")"
|
||||||
stack[-2] << stack.pop
|
stack[-2] << stack.pop
|
||||||
|
when /^"(.*)\"$/
|
||||||
|
stack[-1] << $1
|
||||||
else
|
else
|
||||||
stack[-1] << tok
|
stack[-1] << tok
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue