Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

some code not work on master branch #9

Closed
nedoskiv opened this issue Mar 29, 2018 · 10 comments
Closed

some code not work on master branch #9

nedoskiv opened this issue Mar 29, 2018 · 10 comments

Comments

@nedoskiv
Copy link

nedoskiv commented Mar 29, 2018

I have this code in an .html file (and few similar lines, all not working):
<?lua local a=frj("listtitle") if a~=false then return ('<h2>Пълен списък на таговете с описание:</h2><a style="font-weight:bold;" href="fulllist.html">'..a.lt..'</a>') else return('<h2>Няма генериран списък</h2>')end?>

on dev nodemcu release all works fine, but on master branch line is displayed "as is" from the browser. Web server do not catch it to execute as lua code. Short lines works, not sure where the problem is.

@bondrogeen
Copy link
Owner

bondrogeen commented Mar 29, 2018

<?lua local a=frj("listtitle") local r if a~= false then r='<h2>Пълен списък на таговете с описание:</h2><a style="font-weight:bold;" href="fulllist.html">'..a.lt..'</a>' else r='<h2>Няма генериран списък</h2>' end return r?>

and if so?

p.s. if the function returns a boolean, why not specify how
if a then ... ?

@nedoskiv
Copy link
Author

nedoskiv commented Apr 2, 2018

Code that you suggest do not work either, it is displayed "as is" into browser. Guess regexpr do not catch it somehow, but i'm not good with regexpr and cannot fix it :)
(If I execute that one line code into lua console, it works fine)

@bondrogeen
Copy link
Owner

Is there no new line in the code?
Can I look at the whole file?

@nedoskiv
Copy link
Author

nedoskiv commented Apr 2, 2018

rfidlist.html.gz

@bondrogeen
Copy link
Owner

The file you have compressed it will not handle the embedded code. If you want the code to be processed, do not compress it in .gz
https://github.com/bondrogeen/web-server/blob/master/doc/en/README.md#restrictions

@nedoskiv
Copy link
Author

nedoskiv commented Apr 3, 2018

I compress it because github do not allow me to upload .html file - it is just an .html file

@bondrogeen
Copy link
Owner

OK, I'll check later.

@bondrogeen
Copy link
Owner

I checked. The readline () problem in the documentation says that it reads 1024 bytes, but it turns out that 256 bytes

@bondrogeen
Copy link
Owner

bondrogeen commented Apr 4, 2018

Update the firmware, in the new version this problem was eliminated.

I just checked it.
http://nodemcu-build.com/builds/nodemcu-master-19-modules-2018-04-04-15-06-33-integer.bin
This was built against the master branch and includes the following modules: adc, cron, crypto, file, gpio, http, i2c, mqtt, net, node, ow, pcm, pwm, rotary, sjson, spi, tmr, uart, wifi.

@nedoskiv
Copy link
Author

nedoskiv commented Apr 5, 2018

Thank you, I will stick to dev release.

@nedoskiv nedoskiv closed this as completed Apr 5, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants