Page 1 of 1

Improve Website Plugin

Posted: 18 Feb 2013 20:43
by jeemo
Just downloaded and tried this plugin. When running the Hyperlink/Text tab an error message as shown below appeared.

...torianPluginsImprove Website or CD DVD HTML.fh_lua:3085: stack overflow
stack traceback:
     ...torianPluginsImprove Website or CD DVD HTML.fh_lua:3085: in function 'strHyper'
     ...torianPluginsImprove Website or CD DVD HTML.fh_lua:3103: in function 'strHyper'
     ...torianPluginsImprove Website or CD DVD HTML.fh_lua:3103: in function 'strHyper'
     ...torianPluginsImprove Website or CD DVD HTML.fh_lua:3103: in function 'strHyper'
     ...torianPluginsImprove Website or CD DVD HTML.fh_lua:3103: in function 'strHyper'
     ...torianPluginsImprove Website or CD DVD HTML.fh_lua:3103: in function 'strHyper'
     ...torianPluginsImprove Website or CD DVD HTML.fh_lua:3103: in function 'strHyper'
     ...torianPluginsImprove Website or CD DVD HTML.fh_lua:3103: in function 'strHyper'
     ...torianPluginsImprove Website or CD DVD HTML.fh_lua:3103: in function 'strHyper'
     ...torianPluginsImprove Website or CD DVD HTML.fh_lua:3103: in function 'strHyper'
     ...
     ...torianPluginsImprove Website or CD DVD HTML.fh_lua:3103: in function 'strHyper'
     ...torianPluginsImprove Website or CD DVD HTML.fh_lua:3103: in function 'strHyper'
     ...torianPluginsImprove Website or CD DVD HTML.fh_lua:3103: in function 'strHyper'
     ...torianPluginsImprove Website or CD DVD HTML.fh_lua:3103: in function 'strHyper'
     ...torianPluginsImprove Website or CD DVD HTML.fh_lua:3226: in function 'IntImproveHTML'
     ...torianPluginsImprove Website or CD DVD HTML.fh_lua:3865: in function
     (tail call): ?
     [C]: in function 'MainLoop'
     ...torianPluginsImprove Website or CD DVD HTML.fh_lua:3980: in function 'GUI_MainDialogue'
     ...torianPluginsImprove Website or CD DVD HTML.fh_lua:3998: in main chunk

After closing the error window, the frozen window was still in view. Clicking the 'Stop Converting URL' button didn't work.  It was at 33% and 3sec. Using the Wondows X Stop button closed it.  This left the Main Window present but nothing worked on it. Again using the Wondows X Stop button closed it.

Repeated attempts produced identical results.

ID:6766

Improve Website Plugin

Posted: 18 Feb 2013 22:42
by tatewise
Sorry about that John.

I have spotted the problem and fixed the code.

Version 2.1 should be available from the Plugin Store tomorrow.

It is caused by some text field containing one of the following, other than in a genuine hyperlink URL:://
mailto:
www.

Improve Website Plugin

Posted: 20 Feb 2013 20:13
by jeemo
Thanks Mike, now working OK although the new pages don't validate as '_blank' is not valid XHTML code.  That's difficult to fix without using JavaScript

Improve Website Plugin

Posted: 20 Feb 2013 20:52
by tatewise
I am aware of the problem John, but it is not _blank that is invalid but the target= attribute.
That is why the Help & Advice says:
'The alternative is to open In new Tab or Window although this is officially deprecated on the Internet.'
The implication is you are free to use it on CD/DVD.

As you suggest, one workaround is for the Plugin to substitute
target='_blank'
with JavaScript such as
onclick='window.open(this.href,'_blank');return false;'
but if the user has JavScript disabled that won't work.

Another workaround I've seen suggested is to alter the !DOCTYPE from XHTML 1.0 Strict to XHTML 1.0 Transitional.

Have you any other proposals?

It seems to work in all browsers anyway, so pragmatically what is the problem?

If you really MUST have XHTML 1.0 Strict then don't use the target='_blank' option.

Improve Website Plugin

Posted: 21 Feb 2013 20:44
by jeemo
Sorry Mike.  I quoted the value not the attribute.

I was just pointing this out but it's not a big deal.  All browsers (maybe even all versions) recognise target as an attribute, so the pages will render properly and go to a new tab.
As you suggest, one workaround is for the Plugin to substitute
target='_blank'
with JavaScript such as
onclick='window.open(this.href,'_blank');return false;'
but if the user has JavScript disabled that won't work.
On all my Historian pages I use the 'noscript' tag to generate a warning to catch a browser where JavaScript has been turned off.


An interesting aside - I just found here on FHUG, if I insert the word noscript in the normal tag brackets , the spelling changes to noscrypt e.g.