http.lua: Fix parsing problem.

The closing '?>' needs to be printed using '?<?vlc print ">" ?>' to prevent a parse error.

Signed-off-by: Rémi Denis-Courmont <remi@remlab.net>
This commit is contained in:
Alexandr Koverninsky 2019-07-15 16:25:53 +03:00 committed by Rémi Denis-Courmont
parent 03a2c820ea
commit d26e4b793c
8 changed files with 12 additions and 15 deletions

View File

@ -3027,7 +3027,7 @@
return false;
};
var xsl = {
'nest' : '<' + '?xml version="1.0" encoding="utf-8" ?<?vlc print '>'?>' +
'nest' : '<' + '?xml version="1.0" encoding="utf-8" ?>' +
'<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" >' +
'<xsl:output method="html" encoding="utf-8" omit-xml-declaration="yes" standalone="no" indent="no" media-type="text/html" />' +
'<xsl:template match="/">' +
@ -3088,7 +3088,7 @@
'</xsl:template>' +
'</xsl:stylesheet>',
'flat' : '<' + '?xml version="1.0" encoding="utf-8" ?<?vlc print '>'?>' +
'flat' : '<' + '?xml version="1.0" encoding="utf-8" ?>' +
'<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" >' +
'<xsl:output method="html" encoding="utf-8" omit-xml-declaration="yes" standalone="no" indent="no" media-type="text/xml" />' +
'<xsl:template match="/">' +

View File

@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8" standalone="yes" ?<?vlc print'>'?>
<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
<?vlc --[[
vim:syntax=lua
<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - >

View File

@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8" standalone="yes" ?<?vlc print'>'?>
<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
<?vlc --[[
vim:syntax=lua
<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - >

View File

@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8" standalone="yes" ?<?vlc print'>'?>
<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
<?vlc --[[
vim:syntax=lua
<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - >

View File

@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8" standalone="yes" ?<?vlcprint'>'?>
<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
<?vlc --[[
vim:syntax=lua
<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - >

View File

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8" standalone="yes" ?<?vlc print '>'
--[[
<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
<?vlc --[[
vim:syntax=lua
<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - >
< vlm.xml: VLC media player web interface

View File

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8" standalone="yes" ?<?vlc print '>'
--[[
<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
<?vlc --[[
<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - >
< vlm_cmd.xml: VLC media player web interface
< - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - >

View File

@ -73,11 +73,8 @@ function process_raw(filename)
end
str=string.rep("=",#str-1)
--[[ FIXME:
<?xml version="1.0" encoding="charset" standalone="yes" ?> is still a problem. The closing '?>' needs to be printed using '?<?vlc print ">" ?>' to prevent a parse error.
--]]
local code0 = string.gsub(input,escape(close_tag)," print(["..str.."[")
local code1 = string.gsub(code0,escape(open_tag),"]"..str.."]) ")
local code0 = string.gsub(input,escape(open_tag),"]"..str.."]) ")
local code1 = string.gsub(code0,"(%]"..str.."%]%) "..".-)("..escape(close_tag)..")","%1 print(["..str.."[")
local code = "print(["..str.."["..code1.."]"..str.."])"
--[[ Uncomment to debug
if string.match(filename,"vlm_cmd.xml$") then