0
<html>
<header>
</header>
<body>
<div class='rebol'>
<pre>
Rebol [
    Title: "rebol script embedded in html"
    Author-Url: <a href=http://reboltutorial.com/blog/protect-rebol-script-with-php/>http://reboltutorial.com/blog/protect-rebol-script-with-php/</a>
    Script-Url:  <a href=http://reboltutorial.com/source/rebolscriptembedded.html>http://reboltutorial.com/source/rebolscript.html</a>
    Date:  24-Aug-2009
    Purpose: {
            demo of rebol script embedded in html
    }
]
ask "You're successfull!"
</pre>
</div>
</body>

If tested in Rebol's Console this gives

>> do read clipboard://
You're successfull!
== </body>
>>

Why does it return and how to prevent this if possible ?

Rebol Tutorial
  • 2,738
  • 2
  • 25
  • 36

2 Answers2

3

First: a REBOL script starts with the REBOL [...] header, so everything up to this header will be ignored by the REBOL interpreter. Second: tags are a valid datatype in REBOL. So upon executing your example script, there are three more values following the ask ... expression and the last of those values (</body>) will be returned as the result of your script.

To prevent this, you can add a quit where you want your script to end, i.e. after the ask expression in your example.

earl
  • 40,327
  • 6
  • 58
  • 59
  • 2
    Also, you can add boundaries to a script in order to correctly embed it: `
    [REBOL [...] ...]
    `.
    – rgchris Nov 13 '12 at 22:02
1

<header> is not a valid HTML tag. You mean <head>

pavium
  • 14,808
  • 4
  • 33
  • 50