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

Re: Going to try out a UK based forum


On 11/29/25 10:17 AM, Bruce Steers wrote:
Side note...
anyone got a highlight.js file for gambas?
I've basically copied the VB.Net one and modified the keywords.

Even though "repository.xml" (in vendor/s9e/text-formatter/src/Plugins/BBCodes/Configurator/) says:
<!-- [CODE] BBCode, uses highlight.js for highlighting: https://highlightjs.org/ -->
the phpBB3 CODE bbcode doesn't respect the 'lang' attribute. All code is displayed in green no regardless of the language specified.

So I ...

1. Downloaded "phpbb-ext-highlighter" from https://github.com/s9e/phpbb-ext-highlighter/,
2. Created a "s9e/" directory in the phpBB3 "ext/" directory and unzipped the archive in the newly created directory,
3. Renamed the extracted directory to "highlighter" so that it exists at "phpbb3_root/ext/s9e/highlighter/",
4. Navigated to "Manage Extensions" on the ACP "Customise" tab and enabled the newly installed extension.

Then I created a post with the following content:
[code lang=basic]
Dim sArr as String[]

sArr = Split("Hello\nWorld", "\n")
For Each sValue in sArr
  Print sValue,
Next
Print
[/code]

It's not fully Gambas-ized, but it works.

The version of highlight.js that gets loaded, @10.6.0 I believe, is somewhat close to the latest @11.9. But, I think that could be corrected, and also possibly made to load a custom highlight.js from the local system.


--
Lee

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


References:
Going to try out a UK based forumBruce Steers <bsteers4@xxxxxxxxx>