[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: use a gambas web cgi in a phpBB forum


On 11/28/25 12:20 PM, Bruce Steers wrote:
no you misunderstand.  it's not me doing it, its the way phpBB token {TEXT} is replaced.
So in your example above it would result like this..

  var txt = `Hello
you
beautiful
world!`;
So no \n chars in a single line, just actual new lines , so it's a syntax error in the code it generates.

I guess I do misunderstand. I thought you were trying to send multiline text to a Gambas web cgi script so it could be highlighted and returned; but that the LF characters were being stripped before reaching the cgi script.

Assigning a multiline string by enclosing it within backticks is not a syntax error in JavaScript. They are called template literals. The string in the variable 'txt' does contain newline characters (it must) even though they are not represented by "\n" upon display. Replacing "var txt = `Hello\nyou\nbeautiful\nworld!`;" in that example with:
[code]
     var txt = `Hello
you
beautiful
world!`;
[/code]

would also work.


The way I understand how BBCode works in a phpBB forum is: a post, that contains bbcode, is submitted by a user; the content of that post which includes bbcode is POSTed to the server; the PHP is parsed; the bbcode is parsed; and the result is sent back to the user's browser. I think what I also didn't understand is exactly where in that process you were trying to highlight the Gambas code by sending it for processing to the cgi script.

I don't see why it couldn't be done the way you originally wanted to, but maybe you've found a way you prefer.


--
Lee

--- Gambas User List Netiquette [https://gambaswiki.org/wiki/doc/netiquette] ----
--- Gambas User List Archive [https://lists.gambas-basic.org/archive/user] ----


Follow-Ups:
Re: use a gambas web cgi in a phpBB forumLee <t.lee.davidson@xxxxxxxxx>
References:
use a gambas web cgi in a phpBB forumBruce Steers <bsteers4@xxxxxxxxx>
Re: use a gambas web cgi in a phpBB forumLee <t.lee.davidson@xxxxxxxxx>
Re: use a gambas web cgi in a phpBB forumBruce Steers <bsteers4@xxxxxxxxx>
Re: use a gambas web cgi in a phpBB forumLee <t.lee.davidson@xxxxxxxxx>
Re: use a gambas web cgi in a phpBB forumBruce Steers <bsteers4@xxxxxxxxx>